Re: json_encode() bug

From: Date: Fri, 01 Feb 2008 19:39:38 +0000
Subject: Re: json_encode() bug
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-35069@lists.php.net to get a copy of this message
On Feb 1, 2008 8:13 PM, Cristian Rodriguez <judas.iscariote@gmail.com> wrote: > 2008/1/25, Stanislav Malyshev <stas@zend.com>: > > > Now this is an easy fix but would lead to bad strings silently converted > > to empty strings. The question is - should we have an error there? If > > so, which one - E_WARNING, E_NOTICE? I'm for E_WARNING. > > Yes , E_WARNING is the right thing to have IMHO. Stupid question, who actually checks for E_* in his code at runtime after having called such functions? Not me and I would hate to. It sounds to me like a perfect exception use case. As this function can return nearly everything scalar we have (boolean, string, null, integer,...) we can't use our normal "returns FALSE on failure". Cheers, -- Pierre http://blog.thepimp.net | http://www.libgd.org

« previous php.internals (#35069) next »