<div dir="ltr">Package: php5-json<div>Version: 1.3.6</div><div><br></div><div>(This is from an up-to-date Debian Jessie 63 bit install, using PHP 5.6.17, package version as reported by phpinfo())</div><div><br></div><div>I reported this bug to PHP. They said it was a replacement component in Debian's PHP.</div><div>  <a href="https://bugs.php.net/bug.php?id=71900">https://bugs.php.net/bug.php?id=71900</a><br></div><div><br></div><div>Description:</div><div>------------</div><div><br></div><div>The json_decode function produces </div><div>   PHP Notice:  json_decode(): integer overflow detected in .../test.php on line 11</div><div>when the value concerned is 9223372036854775807 (i.e. PHP_INT_MAX), which is a valid value.</div><div><br></div><div>This has a particular impact in decoding certain results from elasticsearch which contain max int values.</div><div><br></div><div>Test script:</div><div>---------------</div><div><?php</div><div><br></div><div>echo PHP_INT_MAX, "\n";</div><div><br></div><div>$a = array('a' => PHP_INT_MAX); /* it works OK if you put PHP_INT_MAX-1 here */</div><div>print_r($a);</div><div>$j = json_encode($a);</div><div><br></div><div>echo $j, "\n";</div><div><br></div><div>$b = json_decode($j); /* produces the incorrect error message */</div><div>print_r($b);</div><div><br></div><div><br></div><div>Expected result:</div><div>----------------</div><div>No warning.</div><div><br></div><div><br></div><div>Actual result:</div><div>--------------</div><div>PHP Notice:  json_decode(): integer overflow detected</div><div><br></div></div>