Bug #71900 [Fbk->NoF]: json_decode warns of integer overflow for max int

From: Date: Sun, 03 Apr 2016 04:22:26 +0000
Subject: Bug #71900 [Fbk->NoF]: json_decode warns of integer overflow for max int
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200315@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71900&edit=1 ID: 71900 Updated by: php-bugs@lists.php.net Reported by: david at frankieandshadow dot com Summary: json_decode warns of integer overflow for max int -Status: Feedback +Status: No Feedback Type: Bug Package: Unknown/Other Function Operating System: Debian Jessie (64 bit) PHP Version: 5.6.19 Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2016-03-26 12:17:29] david at frankieandshadow dot com Thank you. Reported to Debian as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=819304 ------------------------------------------------------------------------ [2016-03-25 17:45:19] danack@php.net Hello, I am am unable to reproduce this error on any version of PHP that was released by the PHP team. https://3v4l.org/AasT7 I think you need to open a ticket with the Debian maintainers of PHP. They replaced the json extension that PHP ships with, with one that had a different license. ------------------------------------------------------------------------ [2016-03-25 14:55:24] david at frankieandshadow dot com Description: ------------ This is actually version 5.6.17, it is not practical for me to upgrade currently. 5.6.17 is the most up to date Debian Jessie distribution. The json_decode function produces PHP Notice: json_decode(): integer overflow detected in .../test.php on line 11 when the value concerned is 9223372036854775807 (i.e. PHP_INT_MAX), which is a valid value. This has a particular impact in decoding certain results from elasticsearch which contain max int values. Test script: --------------- <?php echo PHP_INT_MAX, "\n"; $a = array('a' => PHP_INT_MAX); /* it works OK if you put PHP_INT_MAX-1 here */ print_r($a); $j = json_encode($a); echo $j, "\n"; $b = json_decode($j); /* produces the incorrect error message */ print_r($b); Expected result: ---------------- No warning. Actual result: -------------- PHP Notice: json_decode(): integer overflow detected ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71900&edit=1

« previous php.bugs (#200315) next »