- json_decode: documentation ( source)
- print_r: documentation ( source)
- json_encode: documentation ( source)
<?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);