From 9f2ab75b1096b881ee97eb2b436763aa14c19635 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 18 Oct 2016 19:11:18 +0200 Subject: [PATCH] Fixed bug #73329 (Float)"Nano" == NAN The special cases (float)"inf", etc. were never intended and are caused by the updated strtod lib. While it might be nice as an easy way to produce Inf and NaN special values, it was never documented and cause BC breaches. --- Zend/zend_strtod_int.h | 4 ++++ tests/lang/bug73329.phpt | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests/lang/bug73329.phpt diff --git a/Zend/zend_strtod_int.h b/Zend/zend_strtod_int.h index c1f66eb19ce..5a6644b878e 100644 --- a/Zend/zend_strtod_int.h +++ b/Zend/zend_strtod_int.h @@ -68,6 +68,10 @@ typedef unsigned long int uint32_t; #undef USE_LOCALE #endif +#ifndef NO_INFNAN_CHECK +#define NO_INFNAN_CHECK +#endif + #ifdef WORDS_BIGENDIAN #define IEEE_BIG_ENDIAN 1 #else diff --git a/tests/lang/bug73329.phpt b/tests/lang/bug73329.phpt new file mode 100644 index 00000000000..938f8bac24f --- /dev/null +++ b/tests/lang/bug73329.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #73329 (Float)"Nano" == NAN +--FILE-- + +==DONE== +--EXPECT-- +float(0) +float(0) +float(0) +float(0) +==DONE==