On 06/24/2012 05:12 AM, Nikita Popov wrote: > The main problem with not throwing a warning is that it makes > debugging the error quite hard. json_last_error() only gives you an > error code. So you have to use some script like the one used as an > example in php.net/json_last_error to figure out what the particular > error code actually means. This is obviously a lot more inconvenient > than simply seeing "Oh, this failed because I passed an Inf".
So how about: mixed json_last_error ( [bool $error_string = false] ) Returns the last error (if any) occurred during the last JSON encoding/decoding. By default an integer constant from the table below is returned. If $error_string is true, an array containing both the error constant and a string representation of the error is returned. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php