Hi Duncan,
Craig Duncan wrote:
On 27 July 2017 at 16:57, Niklas Keller <
[email protected]> wrote:
It should rather just throw exceptions. Warnings do not really allow error
handling, they just allow error reporting.
Agreed, but I can't see Exceptions passing the vote. Warnings can be
silenced by those that don't care and converted to Exceptions by those that
do
Could we not simply make it a flag? e.g.
$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. :)
--
Andrea Faulds
https://ajf.me/