ID: 21871
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Open
+Status: Verified
Bug Type: Zend Engine 2 problem
Operating System: RedHat 7.3
PHP Version: 5CVS-2003-01-24 (dev)
Previous Comments:
------------------------------------------------------------------------
[2003-01-24 19:34:19] [EMAIL PROTECTED]
Given an instance of a nested class, get_class() returns the "::
separated" name for it, as expected. However, passing that value right
back to class_exists() always fails -- i.e., returns FALSE.
<?php
class Foo {
class Bar {
}
}
$x = new Foo::Bar;
if (class_exists(get_class($x))) {
echo "x is looking good\n";
} else {
echo "x is apparently not itself\n";
}
?>
In addition, get_declared_classes() will only report on the top-level
classes, leaving out any that are nested. In this example, it would
report "Foo", but not "Foo::Bar".
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21871&edit=1