1
0
mirror of https://github.com/php/php-src.git synced 2026-04-01 21:22:13 +02:00

Merge branch 'PHP-7.0'

This commit is contained in:
Andrea Faulds
2016-01-08 17:21:59 +00:00
2 changed files with 18 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
--TEST--
Bug #71314 (var_export(INF) prints INF.0)
--FILE--
<?php
var_export(INF);
echo PHP_EOL;
var_export(-INF);
echo PHP_EOL;
var_export(NAN);
echo PHP_EOL;
--EXPECT--
INF
-INF
NAN

View File

@@ -463,8 +463,10 @@ again:
/* Without a decimal point, PHP treats a number literal as an int.
* This check even works for scientific notation, because the
* mantissa always contains a decimal point.
* We need to check for finiteness, because INF, -INF and NAN
* must not have a decimal point added.
*/
if (NULL == strchr(tmp_str, '.')) {
if (zend_finite(Z_DVAL_P(struc)) && NULL == strchr(tmp_str, '.')) {
smart_str_appendl(buf, ".0", 2);
}
efree(tmp_str);