Hi Marc, > -----Original Message----- > From: Marc Bennewitz [mailto:dev@mabe.berlin] > Sent: Sunday, October 23, 2016 12:56 PM > To: PHP Internals List <internals@lists.php.net> > Subject: [PHP-DEV] strtod and NaN vs. zero > > Hi internals, > > On casting a non numeric value to a float in PHP the result will be float(0). > > In PHP-7.0 an exception was introduced that on casting a string "/\s*NaN\s*/i" > will result in float(NaN). > > https://3v4l.org/2Xakm > It is a BC breaching bug and was fixed https://bugs.php.net/bug.php?id=73329 . Cast of string to number is always zero, a way to change it would cause another BC breach which IMHO were not worthwhile.
Regards Anatol -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php