From 10522700013fd67077d03c395fd5143c4e5c9c03 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Mon, 12 Jan 2026 22:45:24 +0100 Subject: [PATCH] Add test for GH-20880 (#20919) Closes GH-20880. --- ext/opcache/tests/jit/gh20880.phpt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ext/opcache/tests/jit/gh20880.phpt diff --git a/ext/opcache/tests/jit/gh20880.phpt b/ext/opcache/tests/jit/gh20880.phpt new file mode 100644 index 0000000000000..e8d0388fe66b6 --- /dev/null +++ b/ext/opcache/tests/jit/gh20880.phpt @@ -0,0 +1,27 @@ +--TEST-- +GH-20880 (JIT (tracing): NAN float comparisons incorrectly return true) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +--FILE-- + $max) { + return $value; + } + return $max; +} + + +$max = 0.0; +for ($i = 0; $i < 100000; $i++) { + $max = observe(1.0, $max); + $max = observe(3.0, $max); +} + +$max = observe(4.0, $max); +$max = observe(NAN, $max); +var_dump($max); +?> +--EXPECT-- +float(4)