From: Nikita Popov Date: Thu, 10 Nov 2016 13:54:41 +0000 (+0100) Subject: Don't elide undef var notice X-Git-Tag: php-7.2.0alpha1~958^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3048428cf006cc96cc5867aacb5b0815548a9663;p=php Don't elide undef var notice --- diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index 242016e1b3..aea670beb3 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -1657,7 +1657,10 @@ static void zend_t_usage(zend_cfg *cfg, zend_op_array *op_array, zend_bitset use case ZEND_QM_ASSIGN: case ZEND_BOOL: case ZEND_BOOL_NOT: - if (ZEND_OP1_TYPE(opline) == IS_TMP_VAR) { + if (ZEND_OP1_TYPE(opline) == IS_CV) { + opline->opcode = ZEND_CHECK_VAR; + SET_UNUSED(opline->result); + } else if (ZEND_OP1_TYPE(opline) == IS_TMP_VAR) { opline->opcode = ZEND_FREE; SET_UNUSED(opline->result); } else { diff --git a/ext/opcache/tests/block_pass_001.phpt b/ext/opcache/tests/block_pass_001.phpt new file mode 100644 index 0000000000..8a1b691145 --- /dev/null +++ b/ext/opcache/tests/block_pass_001.phpt @@ -0,0 +1,8 @@ +--TEST-- +Block pass: Don't suppress undefined variable notice +--FILE-- + +--EXPECTF-- +Notice: Undefined variable: x in %s on line %d