note 91785 added to function.json-decode
| From: | NickTelford at osu1 dot php dot net | Date: | Thu, 25 Jun 2009 11:06:55 +0000 |
| Subject: | note 91785 added to function.json-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-157471@lists.php.net to get a copy of this message | ||
In PHP <= 5.1.6 trying to decode an integer value that's > PHP_INT_MAX will result in an
intger of PHP_INT_MAX.
In PHP 5.2+ decoding an integer > PHP_INT_MAX will cause a conversion to a float.
Neither behaviour is perfect, capping at PHP_INT_MAX is marginally worse, but the float conversion
loses precision.
If you expect to deal with large numbers at all, let alone in JSON, ensure you're using a
64-bit system.
----
Server IP: 92.48.74.199
Probable Submitter: 81.168.58.46
----
Manual Page -- http://www.php.net/manual/en/function.json-decode.php
Edit -- https://master.php.net/note/edit/91785
Del: integrated -- https://master.php.net/note/delete/91785/integrated
Del: useless -- https://master.php.net/note/delete/91785/useless
Del: bad code -- https://master.php.net/note/delete/91785/bad+code
Del: spam -- https://master.php.net/note/delete/91785/spam
Del: non-english -- https://master.php.net/note/delete/91785/non-english
Del: in docs -- https://master.php.net/note/delete/91785/in+docs
Del: other reasons-- https://master.php.net/note/delete/91785
Reject -- https://master.php.net/note/reject/91785
Search -- https://master.php.net/manage/user-notes.php