01 Oct 2015, PHP 7.0.0 RC 4
- Core:
+ . Fixed bug #70528 (assert() with instanceof adds apostrophes around class
+ name). (Laruence)
. Fixed bug #70481 (Memory leak in auto_global_copy_ctor() in ZTS build).
(Laruence)
--- /dev/null
+--TEST--
+Bug #70528 (assert() with instanceof adds apostrophes around class name)
+--INI--
+zend.assertions=1
+assert.exception=0
+assert.warning=1
+--FILE--
+<?php
+
+namespace Foo;
+class Bar {}
+
+$bar = "Bar";
+assert(new \stdClass instanceof $bar);
+assert(new \stdClass instanceof Bar);
+assert(new \stdClass instanceof \Foo\Bar);
+?>
+--EXPECTF--
+Warning: assert(): assert(new \stdClass() instanceof $bar) failed in %sbug70528.php on line %d
+
+Warning: assert(): assert(new \stdClass() instanceof Bar) failed in %sbug70528.php on line %d
+
+Warning: assert(): assert(new \stdClass() instanceof \Foo\Bar) failed in %sbug70528.php on line %d
zend_ast_export_ex(str, ast->child[1], 0, indent);
smart_str_appendc(str, ')');
break;
- case ZEND_AST_INSTANCEOF: BINARY_OP(" instanceof ", 230, 231, 231);
+ case ZEND_AST_INSTANCEOF:
+ zend_ast_export_ex(str, ast->child[0], 0, indent);
+ smart_str_appends(str, " instanceof ");
+ zend_ast_export_ns_name(str, ast->child[1], 0, indent);
+ break;
case ZEND_AST_YIELD:
if (priority > 70) smart_str_appendc(str, '(');
smart_str_appends(str, "yield ");