Re: [RFC] Raise warnings for json_encode() and json_decode() issues
| From: | Craig Duncan | Date: | Fri, 28 Jul 2017 11:41:23 +0000 |
| Subject: | Re: [RFC] Raise warnings for json_encode() and json_decode() issues | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-100077@lists.php.net to get a copy of this message | ||
On 28 July 2017 at 12:36, Jakub Zelenka <bukka@php.net> wrote:
>
> Also it would break a big amount of code because in case of converting
> errors to exceptions, you start getting a different exception so it would
> have to be handled. I would call the whole proposal just a big BC break
> (I'm aware that we don't consider adding warnings as BC but in this case it
> is) for no benefit at all!
>
>
Hi Jakub, thanks for sharing you opinion.
While I agree there are BC concerns, I don't think it's accurate to say no
benefit at all. I regularly see new (and experienced) developers using
these functions without checking
json_last_error(), trying to figure out
why the app is failing later without any warnings in the log can be very
difficult.