Insensitive names for classes

[email protected] (Marcus and Aviva and Rhiannon) Thu, 16 Aug 2001 00:43:24 +0100
Newsgroups php.lang
Organization Coms.com or MirrorMill Design Partners
Message-ID <[email protected]>
Hi.

No, this is not a posting on not hurting the feelings of your
objects.

I use Java style class names...

class MyClass {
   ...
}

That is mixed case. This works fine until I register the class name
in some kind of list (e.g. for a singleton pattern). "MyClass" and
"myclass" are identical and get_class() returns the lower case
version for each.

This took me a few hours of head scratching to figure out as I was
using references heavily at the time and assumed that I was screwing
them up like everyone else.

This also caught me by surprise. I looked a little deeper and found
that this...

$fred = "Hello";
$FRED = "World";
echo $fred." ".$FRED;

...caused complete chaos.

I am using the OS/2 version of PHP. Does this carry over to the
Linux version or is it a porting issue?

If this is a bug, can we "fix" this or at least have it documented
under get_class(). It may be documented elsewhere, but I could not
find it.

yours, Marcus.

p.s. If people have already mentioned this I apologise, but my
bandwidth is rather low and downloading a month or two of messages
would have taken a while. Sorry to all if I am repeating known
stuff.
-- 
web:- http://www.appo.demon.co.uk
Marcus (mobile): [email protected]
Marcus: [email protected], ICQ:68231455
Aviva: [email protected]