#39435 [Asn->Csd]: wrong instanceof results
| From: | pollita@php.net | Date: | Tue, 12 Dec 2006 23:26:46 +0000 |
| Subject: | #39435 [Asn->Csd]: wrong instanceof results | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-106277@lists.php.net to get a copy of this message | ||
ID: 39435
Updated by: pollita@php.net
Reported By: mp at webfactory dot de
-Status: Assigned
+Status: Closed
Bug Type: Class/Object related
Operating System: any
PHP Version: 5.2.0
Assigned To: pollita
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
This has been changed to throw a proper error message rather than the
uninformative one given. Perhaps in future versions this can be
changed to allow constant strings giving the expected output, but not
currently.
Previous Comments:
------------------------------------------------------------------------
[2006-11-08 18:26:52] johannes@php.net
Sara should have a patch as soon as she gets online
------------------------------------------------------------------------
[2006-11-08 17:36:17] mp at webfactory dot de
Description:
------------
instanceof produces wrong results when the first operand is not an
object instance but a class name or a string containing a class name.
Reproduce code:
---------------
var_dump(Iterator instanceof Traversable);
var_dump("Iterator" instanceof Traversable);
Expected result:
----------------
bool(true)
bool(true)
Actual result:
--------------
bool(false)
Fatal error: Invalid opcode 138/1/1. in ...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39435&edit=1