Re: [RFC] Raise warnings for json_encode() and json_decode() issues
| From: | Craig Duncan | Date: | Fri, 28 Jul 2017 11:51:07 +0000 |
| Subject: | Re: [RFC] Raise warnings for json_encode() and json_decode() issues | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-100079@lists.php.net to get a copy of this message | ||
On 28 July 2017 at 12:46, Andrey Andreev <narf@devilix.net> wrote:
>
> This is a long shot, but here's an idea: an OOP API throwing exceptions.
>
> Would require more work both to implement and use, but it would surely
> be less error-prone and there'd be no BC break.
>
Hi Andrey, Yes that would resolve all BC issues, however that wouldn't help
with new developers picking up the
json_* functions and using them
dangerously.
As pointed out in the original thread, there are plenty of wrappers that
provide this feature, the problem is that core functions have a huge gotcha.
If we introduced a new API then we'd need to deprecate the json_*
functions to make users aware, which I imagine would be the most
contentious thing suggested thus far