Re: json_encode() behavior for incorrectly encoded strings
| From: | Nikita Popov | Date: | Thu, 28 Jun 2012 18:36:40 +0000 |
| Subject: | Re: json_encode() behavior for incorrectly encoded strings | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-61031@lists.php.net to get a copy of this message | ||
On Wed, Jun 27, 2012 at 2:19 PM, Nikita Popov <nikita.ppv@googlemail.com> wrote:
> I looked at a few other error functions (of which we by the way we
> have *loads*, which is a bad sign) and indeed it seems that they all
> use a separate function to get the error message. Most use a
> xyz_errno() + xyz_error() pair.
>
> So it seems reasonable to instead provide the functionality via
> json_last_error_msg().
I replaced json_last_error(true) with json_last_error_msg() now (in
https://github.com/php/php-src/commit/974324676b2436f159f42d9241c569f813471684).
I kind of get the feeling that the changes turned out much more
intrusive than originally thought. Maybe the best thing to do would be
to revert all changes on 5.3/5.4 (including the very original one that
landed only on 5.3) and only introduce the new behavior on master. Or
do you think that the changes are okay for the release branches?
Nikita