#26867 [Opn]: get_declared_classes() does not return interfaces

From: Date: Sun, 11 Jan 2004 00:37:40 +0000
Subject: #26867 [Opn]: get_declared_classes() does not return interfaces
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-53081@lists.php.net to get a copy of this message
ID: 26867 User updated by: jaba at inbox dot lv Reported By: jaba at inbox dot lv Status: Open Bug Type: Class/Object related Operating System: Any PHP Version: 5.0.0b3 (beta3) New Comment: I mixed up expected with actual results. Previous Comments: ------------------------------------------------------------------------ [2004-01-10 19:36:09] jaba at inbox dot lv Description: ------------ At PHP5 we have a nice thing called interface. get_declared_classes() returns an array of all - abstract and non-abstract classes, but the array does not contain my interfaces. If interface is loaded by __autoload just like classes, shouldn't it be loaded into classes register too? Is there any way to check is it interface or what? Reproduce code: --------------- <?php interface Dao { function Open(); function Close(); } echo "<p>class_exists('Dao') says that Dao "; echo ( class_exists('Dao') ? 'is defined' : 'is not defined' ); $classes = get_declared_classes(); echo "<p>get_declared_classes() says that Dao "; echo ( in_array('Dao',$classes) ? 'is defined' : 'is not defined' ); ?> Expected result: ---------------- class_exists('Dao') says that Dao is defined get_declared_classes() says that Dao is not defined Actual result: -------------- class_exists('Dao') says that Dao is defined get_declared_classes() says that Dao is defined ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26867&edit=1

« previous php.bugs (#53081) next »