1
0
mirror of https://github.com/php/php-src.git synced 2026-04-20 22:41:20 +02:00
Files
archived-php-src/ext/opcache/tests/jit/reg_alloc_007.phpt
Dmitry Stogov 09bf3463dd Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fix register alloction (missed store)
2022-02-01 22:06:18 +03:00

27 lines
575 B
PHP

--TEST--
Register Alloction 007: Missing store
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
--FILE--
<?php
function test() {
for ($i = 0; $i < 100; $i++) {
$a = $a + $a = $a + !$a = $a;
$aZ = $a;
@$aZ %= $a;
}
}
test();
?>
--EXPECTF--
Warning: Undefined variable $a in %sreg_alloc_007.php on line 4
Fatal error: Uncaught DivisionByZeroError: Modulo by zero in %sreg_alloc_007.php:6
Stack trace:
#0 %sreg_alloc_007.php(9): test()
#1 {main}
thrown in %sreg_alloc_007.php on line 6