xref: /php-src/ext/opcache/tests/jit/cmp_008.phpt (revision c16ad918)
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.protect_memory=1
8--FILE--
9<?php
10function test() {
11    for ($i = 0; $i < 10; $i %= -4 != -4 < ($a = $a + $a)) {
12    }
13}
14test();
15?>
16--EXPECTF--
17Warning: Undefined variable $a in %scmp_008.php on line 3
18
19Warning: Undefined variable $a in %scmp_008.php on line 3
20
21Fatal error: Uncaught DivisionByZeroError: Modulo by zero in %scmp_008.php:3
22Stack trace:
23#0 %scmp_008.php(6): test()
24#1 {main}
25  thrown in %scmp_008.php on line 3
26