Re: json_encode() behavior for incorrectly encoded strings

From: Date: Sat, 23 Jun 2012 23:03:24 +0000
Subject: Re: json_encode() behavior for incorrectly encoded strings
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-60952@lists.php.net to get a copy of this message
On Sun, 2012-06-24 at 00:24 +0200, Nikita Popov wrote: > Yes, I feel like we must discuss this a thousand times anew. There > clearly is no consensus about it. Just look at the responses in this > thread and in other discussions relating this issue. When people read > "throws a warning, but only if display_errors=Off" they automatically > replace the Off with an On in their mind. The behavior is simply that > unintuitive. Maybe it is simply time to rethink the error handling. The current system doesn't really allow to distinguish between "debugging help" and true "error reporting". I don't have a good proposal, but recently I often struggled whether to throw an E_NOTICE from some code in order to help the user while debugging and found myself adding extension-specific error handling routines ... this case here seems to suffer from a related problem. Anybody up for an RFC? (This might also include cleanup the usage of exceptions for internals, and probably converting E_RECOVERABLE to exception) johannes, just throwing some thoughts in the discussion

« previous php.internals (#60952) next »