xref: /PHP-8.1/ext/opcache/tests/jit/mul_008.phpt (revision c29f6baa)
1--TEST--
2JIT MUL: 008 incorrect elimination of type store
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7opcache.jit_buffer_size=1M
8opcache.protect_memory=1
9--SKIPIF--
10<?php if (PHP_INT_SIZE != 8) die("skip: 64-bit only"); ?>
11--FILE--
12<?php
13function foo(int $a){
14    $a=$a%10;
15    $a=$f=$a*(6158978401740);
16    $a=$f=$a*(261740);
17    $a%0;
18}
19foo(3);
20?>
21--EXPECTF--
22Fatal error: Uncaught DivisionByZeroError: Modulo by zero in %smul_008.php:6
23Stack trace:
24#0 %smul_008.php(8): foo(%d)
25#1 {main}
26  thrown in %smul_008.php on line 6
27