<?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);
9223372036854775807
Array
(
[a] => 9223372036854775807
)
Fatal error: Call to undefined function json_encode() in /in/AasT7 on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.4
Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/AasT7 on line 3
PHP_INT_MAX
Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/AasT7 on line 5
Array
(
[a] => PHP_INT_MAX
)
Fatal error: Call to undefined function json_encode() in /in/AasT7 on line 7
Process exited with code 255.
Output for 4.4.5 - 4.4.9
9223372036854775807
Array
(
[a] => 9223372036854775807
)
Fatal error: Call to undefined function: json_encode() in /in/AasT7 on line 7
Process exited with code 255.
Output for 4.4.0 - 4.4.4
9223372036854775807
Array
(
[a] => 9223372036854775807
)
Fatal error: Call to undefined function: json_encode() in /in/AasT7 on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.11
Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/AasT7 on line 3
PHP_INT_MAX
Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/AasT7 on line 5
Array
(
[a] => PHP_INT_MAX
)
Fatal error: Call to undefined function: json_encode() in /in/AasT7 on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/AasT7 on line 3
PHP_INT_MAX
Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/AasT7 on line 5
Array
(
[a] => PHP_INT_MAX
)
Fatal error: Call to undefined function: json_encode() in /in/AasT7 on line 7