note 44214 deleted from language.constants.predefined by peehaa
| From: | peehaa@php.net | Date: | Mon, 22 May 2017 07:27:05 +0000 |
| Subject: | note 44214 deleted from language.constants.predefined by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-209086@lists.php.net to get a copy of this message | ||
Note Submitter: claude at NOSPAM dot claude dot nl
----
Note that __CLASS__ contains the class it is called in; in lowercase. So the code:
class A
{
function showclass()
{
echo __CLASS__;
}
}
class B extends A
{
}
$a = new A();
$b = new B();
$a->showclass();
$b->showclass();
A::showclass();
B::showclass();
results in "aaaa";