xref: /PHP-8.4/ext/opcache/tests/jit/bug81226.phpt (revision c16ad918)
1--TEST--
2Bug #81226: Integer overflow behavior is different with JIT enabled
3--EXTENSIONS--
4opcache
5--INI--
6opcache.enable=1
7opcache.enable_cli=1
8opcache.jit=tracing
9--SKIPIF--
10<?php if (PHP_INT_SIZE != 8) die("skip: 64-bit only"); ?>
11--FILE--
12<?php
13// 65-bit hexadecimal number
14$hex = '10000000000000041';
15
16for ($i = 0; $i < 200; ++$i) {
17    $characterReferenceCode = 0;
18
19    for ($j = 0, $len = strlen($hex); $j < $len; ++$j) {
20        $characterReferenceCode *= 16;
21        $characterReferenceCode += ord($hex[$j]) - 0x0030;
22    }
23
24    assert($characterReferenceCode > 0x10FFFF);
25}
26?>
27OK
28--EXPECT--
29OK
30