Browse Source

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.
pull/2174/head
Anatol Belski 10 years ago
parent
commit
9f2ab75b10
  1. 4
      Zend/zend_strtod_int.h
  2. 18
      tests/lang/bug73329.phpt

4
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

18
tests/lang/bug73329.phpt

@ -0,0 +1,18 @@
--TEST--
Bug #73329 (Float)"Nano" == NAN
--FILE--
<?php
var_dump(
(float)"nanite",
(float)"nan",
(float)"inf",
(float)"infusorian"
);
?>
==DONE==
--EXPECT--
float(0)
float(0)
float(0)
float(0)
==DONE==
Loading…
Cancel
Save