We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f7f0d22 + 1052270 commit c80ac79Copy full SHA for c80ac79
ext/opcache/tests/jit/gh20880.phpt
@@ -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