Hi,
some dude on IRC found out that
php -r 'var_export((object)1 instanceof stdClass);';
results in
class stdClass {
  public $scalar = false;
}

IMHO it should just return true. The ZEND_ENGINE file
doesn't state anything about the precedence of instanceof.

The fix is pretty simple and a patch to zend_language_parser.y
is attached.
make test runs through fine, so I guess it doesn't brake
anything else, but I can't tell for sure of course. It
would be great if someone could look into this.

Best regards,
Jan
--
GPG Key: BB96 56B0
Q: Thank Jan? - A: http://geschenke.an.dasmoped.net/
Index: zend_language_parser.y
===================================================================
RCS file: /repository/ZendEngine2/zend_language_parser.y,v
retrieving revision 1.138
diff -u -r1.138 zend_language_parser.y
--- zend_language_parser.y      11 Feb 2004 22:13:39 -0000      1.138
+++ zend_language_parser.y      16 Feb 2004 14:51:33 -0000
@@ -67,9 +67,10 @@
 %left T_SL T_SR
 %left '+' '-' '.'
 %left '*' '/' '%'
+%nonassoc T_INSTANCEOF
 %right '!' '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST 
T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@'
 %right '['
-%nonassoc T_NEW T_INSTANCEOF T_CLONE
+%nonassoc T_NEW T_CLONE
 %token T_EXIT
 %token T_IF
 %left T_ELSEIF

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to