xref: /PHP-8.1/ext/opcache/tests/jit/bw_not_002.phpt (revision 3d6a7e2b)
1--TEST--
2JIT BW_NOT: 002 Exception handling
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	$j = 0;
13    for ($i = 0; $i < 10; $i++) {
14        $a = ~$j - $a = $j + $j = !$j = $j++;
15    }
16}
17test();
18?>
19--EXPECTF--
20Fatal error: Uncaught TypeError: Cannot perform bitwise not on bool in %sbw_not_002.php:5
21Stack trace:
22#0 %sbw_not_002.php(8): test()
23#1 {main}
24  thrown in %sbw_not_002.php on line 5
25