mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Start block at loop var free
This commit is contained in:
commit
b86fdf84f0
2 changed files with 15 additions and 4 deletions
|
@ -436,13 +436,12 @@ ZEND_API int zend_build_cfg(zend_arena **arena, const zend_op_array *op_array, u
|
|||
flags |= ZEND_FUNC_HAS_EXTENDED_FCALL;
|
||||
break;
|
||||
case ZEND_FREE:
|
||||
if (opline->extended_value == ZEND_FREE_SWITCH) {
|
||||
case ZEND_FE_FREE:
|
||||
if (zend_optimizer_is_loop_var_free(opline)) {
|
||||
BB_START(i);
|
||||
flags |= ZEND_FUNC_FREE_LOOP_VAR;
|
||||
}
|
||||
break;
|
||||
case ZEND_FE_FREE:
|
||||
flags |= ZEND_FUNC_FREE_LOOP_VAR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
12
Zend/tests/code_before_loop_var_free.phpt
Normal file
12
Zend/tests/code_before_loop_var_free.phpt
Normal file
|
@ -0,0 +1,12 @@
|
|||
--TEST--
|
||||
Code before loop var free
|
||||
--FILE--
|
||||
<?php
|
||||
switch ($x > 0) {
|
||||
default:
|
||||
return;
|
||||
Y;
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Undefined variable $x in %s on line %d
|
Loading…
Add table
Add a link
Reference in a new issue