Re: json_last_error
| From: | Jim Lucas | Date: | Fri, 04 Dec 2009 19:16:18 +0000 |
| Subject: | Re: json_last_error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-300252@lists.php.net to get a copy of this message | ||
Kirby Bakken wrote:
> None of the servers I run on have PHP 5.3, and I have no idea when
> they'll be updated. The json_last_error function is in 5.3. What can I
> do to provide a temporary json_last_error function until my servers get
> updated to 5.3? Is there source available for json_last_error somewhere?
>
> Thanks,
>
> Kirby
>
I don't believe you will be able to provide this functionality without
recreating the json_decode() function also.
json_last_error() looks like it retrieves information that is from the last
attempt to run json_decode() on a given string. My guess is that json_decode()
set an internal variable that json_last_error() picks up and returns.
Without having json_decode() say what the problem was/is then you can never
recreate the json_last_error() function.
Jim Lucas