note 106766 deleted from function.json-decode by thiago
| From: | thiago@php.net | Date: | Mon, 05 Dec 2011 18:18:10 +0000 |
| Subject: | note 106766 deleted from function.json-decode by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-184911@lists.php.net to get a copy of this message | ||
Note Submitter: KP
----
Hi,
I just wanted to bring to your attention how that json_decode fails when you have a number with a
value under 1 and preceding zero is not populated.
This is not a bug as it violates JSON spec.
I had to make sure that number is preceded with a zero.
To test that
$json = json_decode('{"a":0.1,"b":-0.1}');
echo json_last_error();
$json = json_decode('{"a":-.1,"b":.1}');
echo json_last_error();