Skip to content

Commit c80ac79

Browse files
committed
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4: Add test for phpGH-20880 (php#20919)
2 parents f7f0d22 + 1052270 commit c80ac79

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

ext/opcache/tests/jit/gh20880.phpt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--TEST--
2+
GH-20880 (JIT (tracing): NAN float comparisons incorrectly return true)
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
--FILE--
7+
<?php
8+
function observe(float $value, float $max): float {
9+
if ($value > $max) {
10+
return $value;
11+
}
12+
return $max;
13+
}
14+
15+
16+
$max = 0.0;
17+
for ($i = 0; $i < 100000; $i++) {
18+
$max = observe(1.0, $max);
19+
$max = observe(3.0, $max);
20+
}
21+
22+
$max = observe(4.0, $max);
23+
$max = observe(NAN, $max);
24+
var_dump($max);
25+
?>
26+
--EXPECT--
27+
float(4)

0 commit comments

Comments
 (0)