Re: json_encode() / json_decode() warnings
| From: | Andrea Faulds | Date: | Sat, 29 Jul 2017 16:55:29 +0000 |
| Subject: | Re: json_encode() / json_decode() warnings | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-100108@lists.php.net to get a copy of this message | ||
Hi Craig,
Craig Duncan wrote:
On 29 July 2017 at 15:16, Andrea Faulds <ajf@ajf.me> wrote:That's true, but if we add it to core we can save people reimplementing it themselves or adding an extra dependency, and perhaps more pertinently, it could be the first step to making this the default behaviour. -- Andrea Faulds https://ajf.me/Could we not simply make it a flag? e.g.Hi Andrea, although that wouldn't break compatibility, it doesn't protect new developers from using them dangerously. That desired functionality is available in many userland libraries, I don't think we gain much from adding it to core. My aim is to make the core functions easier/safer to use out of the box.$bar = json_encode($foo, JSON_THROW_EXCEPTIONS); $baz = json_decode($bar, false, 512, JSON_THROW_EXCEPTIONS);That wouldn't break backwards-compatibility, but would still provide the desired functionality. :)