note 9107 modified in Classes and Objects by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Tue, 17 Oct 2000 21:04:10 +0000 |
| Subject: | note 9107 modified in Classes and Objects by jmcastagnetto | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-6589@lists.php.net to get a copy of this message | ||
[Editor's note: function's and method's names are *not* case sensitive in PHP, this
is a known characteristic of the language, so it is no wonder that the behavior commented here was
observed.]
CORRECTION FROM THE PREVIOUS POST
I noticed the following:
<PRE>
class a {
function something() {
echo "class a something";
}
}
class SomeThing extends a {
function SomeThing (){
echo "SomeThing constructor";
}
}
mySomeThing=new SomeThing;
mySomeThing->something();
</PRE>
would output
SomeThing cunstructor
SomeThing cunstructor
instead of
SomeThing cunstructor
class a something
I had to rename the function in class a to aSomething and call it with mySomeThing->aSomething()
to get it to work properly. I am using php3, and I don't know if this was fixed in php4
http://www.php.net/manual/classes-and-objects.php