diff options
author | Sara Golemon <pollita@php.net> | 2017-07-22 21:23:29 -0400 |
---|---|---|
committer | Sara Golemon <pollita@php.net> | 2017-07-22 21:23:29 -0400 |
commit | e23c132940a2463c0f7034a5443b58fe9e6c96cd (patch) | |
tree | 0507c41c18ec6bad2cb9a4e3285f59e473969065 /tests | |
parent | 401188cbf986e3cbb0ae8d7b49f7ba31b79be9bd (diff) | |
parent | 1229b0f8cb483845e20d6687068a8c5edb79f5af (diff) | |
download | php-git-e23c132940a2463c0f7034a5443b58fe9e6c96cd.tar.gz |
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
Fix compile-time optimization of NAN comparisons
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lang/operators/nan-comparison-false.phpt | 29 |
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) |