|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-04-29 12:07 UTC] stas@php.net
[2013-02-17 13:32 UTC] nikic@php.net
-Status: Open
+Status: Wont fix
-Package: Feature/Change Request
+Package: *General Issues
[2013-02-17 13:32 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Mon Jan 05 02:00:02 2026 UTC |
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)