ID: 22960
Updated by: [EMAIL PROTECTED]
Reported By: thixit at yahoo dot com
-Status: Open
+Status: Bogus
Bug Type: Class/Object related
PHP Version: 4.3.1
New Comment:
It works as expected and intended.
Previous Comments:
------------------------------------------------------------------------
[2003-03-30 05:54:27] thixit at yahoo dot com
Concerning the magical constant __CLASS__
<?php
class foo
{
function a()
{
print __CLASS__ . "\n";
}
}
class bar extends foo
{
function b()
{
print __CLASS__ . "\n";
}
}
$foo = new foo;
$bar = new bar;
print '<pre>';
$foo->a(); // foo
$bar->a(); // foo
$bar->b(); // bar
print '</pre>';
?>
I'm not sure about the definition of magical constant,
but IMHO __CLASS__ should be changed to reflect
the current class that it is in at that moment.
This would be useful when use it in a static method
where get_class() cannot be used.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22960&edit=1