1
0
mirror of https://github.com/php/php-src.git synced 2026-04-08 08:33:06 +02:00

Merge branch 'PHP-8.1'

* PHP-8.1:
  Fix ISSET_ISEMPTY_VAR missoptimization
This commit is contained in:
Dmitry Stogov
2022-04-25 13:31:40 +03:00
2 changed files with 21 additions and 0 deletions

View File

@@ -413,6 +413,8 @@ bool zend_optimizer_update_op1_const(zend_op_array *op_array,
case ZEND_FETCH_IS:
case ZEND_FETCH_UNSET:
case ZEND_FETCH_FUNC_ARG:
case ZEND_ISSET_ISEMPTY_VAR:
case ZEND_UNSET_VAR:
TO_STRING_NOWARN(val);
if (opline->opcode == ZEND_CONCAT && opline->op2_type == IS_CONST) {
opline->opcode = ZEND_FAST_CONCAT;

View File

@@ -0,0 +1,19 @@
--TEST--
ISSET_ISEMPTY_VAR 001: CONST operand of ISSET_ISEMPTY_VAR must be converted to STRING
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
--FILE--
<?php
class A {
function __destruct() {
$i=0;
if (isset($GLOBALS[$i])) y;
}
}
new A;
?>
DONE
--EXPECT--
DONE