mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
parent
45e623da26
commit
f135ed9a8a
2 changed files with 24 additions and 0 deletions
|
@ -826,6 +826,8 @@ done:
|
|||
/* The use might have been optimized away, in which case we will hit the def
|
||||
* instead. */
|
||||
if (use_opline->opcode == ZEND_COPY_TMP && use_opline->result.var == rt_var_num) {
|
||||
start = def_opline + 1 - op_array->opcodes;
|
||||
emit_live_range_raw(op_array, var_num, kind, start, end);
|
||||
return;
|
||||
}
|
||||
} while (!(
|
||||
|
|
22
ext/opcache/tests/opt/coalesce_002.phpt
Normal file
22
ext/opcache/tests/opt/coalesce_002.phpt
Normal file
|
@ -0,0 +1,22 @@
|
|||
--TEST--
|
||||
COALESCE optimization
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.optimization_level=-1
|
||||
--FILE--
|
||||
<?php
|
||||
function t() {
|
||||
$y[" $a "] ??= var_dump();
|
||||
}
|
||||
t();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Undefined variable $a in %scoalesce_002.php on line 3
|
||||
|
||||
Fatal error: Uncaught ArgumentCountError: var_dump() expects at least 1 argument, 0 given in %scoalesce_002.php:3
|
||||
Stack trace:
|
||||
#0 %scoalesce_002.php(3): var_dump()
|
||||
#1 %scoalesce_002.php(5): t()
|
||||
#2 {main}
|
||||
thrown in %scoalesce_002.php on line 3
|
Loading…
Add table
Add a link
Reference in a new issue