I don't like this... we may want to detect "obviously not string"
operands by checking for the result of a comparison instruction.
--- /dev/null
+--TEST--
+Misoptimization when variable is modified by assert()
+--INI--
+zend.assertions=1
+--FILE--
+<?php
+
+function test() {
+ $i = 0;
+ assert('$i = new stdClass');
+ $i += 1;
+ var_dump($i);
+}
+test();
+
+?>
+--EXPECTF--
+Notice: Object of class stdClass could not be converted to int in %s on line %d
+int(2)
flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS;
} else if (zend_string_equals_literal(Z_STR_P(zv), "get_defined_vars")) {
flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS;
+ } else if (zend_string_equals_literal(Z_STR_P(zv), "assert")) {
+ flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS;
} else if (zend_string_equals_literal(Z_STR_P(zv), "func_num_args")) {
flags |= ZEND_FUNC_VARARG;
} else if (zend_string_equals_literal(Z_STR_P(zv), "func_get_arg")) {