Edit report at https://bugs.php.net/bug.php?id=64695&edit=1
ID: 64695
Comment by: cearny at gmail dot com
Reported by: keith at openx dot com
Summary: JSON_NUMERIC_CHECK has issues with strings that are
numbers plus the letter e
Status: Closed
Type: Bug
Package: JSON related
Operating System: CentOS/OSX
PHP Version: 5.3.24
Assigned To: bukka
Block user comment: N
Private report: N
New Comment:
I think this just reared it's ugly head again in 5.6.20 (it works fine in 5.6.18 and 7.0.x).
PHP 5.6.20-1+deb.sury.org~trusty+1, to be more exact.
It complains that Inf and NaN can't be represented in JSON, because it thinks we're
dealing with a hex number I guess?
<?php
echo json_encode(["rss" => "5e879769"]);
echo "\n";
echo json_last_error();
echo "\n";
echo "\n";
echo json_encode(["rss" => "5e879769"], JSON_NUMERIC_CHECK);
echo "\n";
echo json_last_error();
echo "\n";
echo "\n";
Previous Comments:
------------------------------------------------------------------------
[2016-01-27 18:48:14] bukka@php.net
Ah I see. Good catch! That's definitely my fault and I'm sorry for that! I have no idea
why I put it to the 5.5.12 because it should go to 5.5.23 which means it didn't go to
ChangeLog.
I will email Julien (5.5 RM) and ask him if it can be fixed. Thanks!
------------------------------------------------------------------------
[2016-01-26 20:24:01] mark dot caudill at sharpspring dot com
Totally understand and I comprehended that the first time. I was saying that it isn't here at
all and asking if that is something to care about: http://php.net/ChangeLog-5.php
------------------------------------------------------------------------
[2016-01-26 18:50:03] bukka@php.net
It is in the NEWS (changelog) for 5.5 as I linked:
https://github.com/php/php-src/blob/PHP-5.5/NEWS
So there is no issue...
------------------------------------------------------------------------
[2016-01-14 14:15:07] mark dot caudill at sharpspring dot com
Alright - thank you for the clarification. Is there any concern about it not being in the changelog
on php.net?
------------------------------------------------------------------------
[2016-01-13 15:57:29] bukka@php.net
It made it to 5.5 and up. It is in this commit
https://github.com/php/php-src/commit/591dbcabe57a32550fb73223521fa1323773628f
you can also see it in the 5.5 news file - search for JSON_NUMERIC_CHECK
https://github.com/php/php-src/blob/PHP-5.5/NEWS
The reason why you are hitting it is that many distros are bundled with json-c due to a licensing
issue. I am not sure if jsonc has this fixed thought but there is no issue with this core json ext.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=64695
--
Edit this bug report at https://bugs.php.net/bug.php?id=64695&edit=1