ID: 41072 Updated by: [EMAIL PROTECTED] Reported By: atomo64 at gmail dot com Status: Open Bug Type: Feature/Change Request Operating System: Linux 2.6.18 SMP i686 PHP Version: 5.2.1 New Comment:
I'd suggest you use reflection for this: http://www.php.net/reflection Previous Comments: ------------------------------------------------------------------------ [2007-04-13 00:49:11] atomo64 at gmail dot com Description: ------------ At the moment instanceof requires the first 'parameter' to be an object of the class which is to be compared. It would be useful to be able to check without creating the object. Reproduce code: --------------- <?php class MyClass {} $class = 'MyClass'; var_dump($class instanceof MyClass); var_dump($$class instanceof MyClass); var_dump(MyClass instanceof MyClass); ?> Expected result: ---------------- bool(false) bool(true) bool(true) Actual result: -------------- bool(false) bool(false) bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41072&edit=1