summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSara Golemon <pollita@php.net>2017-07-22 20:58:54 -0400
committerSara Golemon <pollita@php.net>2017-07-22 21:22:51 -0400
commitc562d44321ea69612fbe3f7460055e9ed4340baa (patch)
tree124b2bc0ebb10224127f281ff39b2ce83600efed /tests
parentad12da49085c05e11a65eafae1384eae43804d1d (diff)
downloadphp-git-c562d44321ea69612fbe3f7460055e9ed4340baa.tar.gz
Fix compile-time optimization of NAN comparisons
Diffstat (limited to 'tests')
-rw-r--r--tests/lang/operators/nan-comparison-false.phpt29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/lang/operators/nan-comparison-false.phpt b/tests/lang/operators/nan-comparison-false.phpt
new file mode 100644
index 0000000000..f7679b8b67
--- /dev/null
+++ b/tests/lang/operators/nan-comparison-false.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Comparisons with NAN should yield false, even at compile-time
+--FILE--
+<?php
+
+echo "** CONST\n";
+var_dump(0 < NAN);
+var_dump(0 <= NAN);
+var_dump(0 > NAN);
+var_dump(0 >= NAN);
+
+echo "** VAR\n";
+$nan = NAN;
+var_dump(0 < $nan);
+var_dump(0 <= $nan);
+var_dump(0 > $nan);
+var_dump(0 >= $nan);
+
+--EXPECT--
+** CONST
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+** VAR
+bool(false)
+bool(false)
+bool(false)
+bool(false)