xref: /PHP-8.1/ext/opcache/tests/jit/cmp_008.phpt (revision 6f42c073)
1--TEST--
2JIT CMP: 008 Wrong range inference for comparison between IS_LONG and IS_FALSE/IS_TRUE
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7opcache.jit_buffer_size=1M
8opcache.protect_memory=1
9--FILE--
10<?php
11function test() {
12    for ($i = 0; $i < 10; $i %= -4 != -4 < ($a = $a + $a)) {
13    }
14}
15test();
16?>
17--EXPECTF--
18Warning: Undefined variable $a in %scmp_008.php on line 3
19
20Warning: Undefined variable $a in %scmp_008.php on line 3
21
22Fatal error: Uncaught DivisionByZeroError: Modulo by zero in %scmp_008.php:3
23Stack trace:
24#0 %scmp_008.php(6): test()
25#1 {main}
26  thrown in %scmp_008.php on line 3
27