|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-07-20 04:33 UTC] pajoye@php.net
-Status: Open
+Status: Bogus
[2011-07-20 04:33 UTC] pajoye@php.net
[2011-07-20 04:34 UTC] x11 at arturaz dot net
[2011-07-20 04:55 UTC] pajoye@php.net
[2011-07-20 05:01 UTC] x11 at arturaz dot net
[2014-07-04 09:02 UTC] bugs dot php dot net at chsc dot dk
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 21:00:02 2025 UTC |
Description: ------------ PHP does not complain if you check for non-existant class with instanceof. This provides space for subtle errors, like checking for DateRange when only Date_Range class is defined. Test script: --------------- <?php echo PHP_VERSION . "\n"; error_reporting(E_ALL); class Foo {} $a = new Foo; // Notice that Bar class is never defined, however PHP does not complain about missing class. if ($a instanceof Bar) { echo "Should be an error\n"; } else { echo "PHP fail\n"; } Expected result: ---------------- Compiler error thrown saying that Bar was not found. Actual result: -------------- Nothing happens.