note 74514 added to function.get-class
| From: | KerryKobashi at osu1 dot php dot net | Date: | Sun, 15 Apr 2007 06:58:07 +0000 |
| Subject: | note 74514 added to function.get-class | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125408@lists.php.net to get a copy of this message | ||
It should be noted that class names are represented in lowercase under PHP 4.x.
class MyClass {
function MyClass() {
}
function ShowClass() {
echo get_class($this);
}
}
$p = new MyClass();
$p->ShowClass();
Displays:
myclass
If you serialize $p, you will also see that the class name is lower case as well:
$p = new MyClass();
echo serialize($p);
Displays:
O:7:"myclass":1:{s:3:"val";i:100;}
In my case, this is an important point for mapping class names to database table names (and vice
versa).
----
Server IP: 69.39.81.135
Probable Submitter: 24.6.9.246
----
Manual Page -- http://www.php.net/manual/en/function.get-class.php
Edit -- https://master.php.net/note/edit/74514
Del: integrated -- https://master.php.net/note/delete/74514/integrated
Del: useless -- https://master.php.net/note/delete/74514/useless
Del: bad code -- https://master.php.net/note/delete/74514/bad+code
Del: spam -- https://master.php.net/note/delete/74514/spam
Del: non-english -- https://master.php.net/note/delete/74514/non-english
Del: in docs -- https://master.php.net/note/delete/74514/in+docs
Del: other reasons-- https://master.php.net/note/delete/74514
Reject -- https://master.php.net/note/reject/74514
Search -- https://master.php.net/manage/user-notes.php