|
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-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 08:00:02 2025 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)