Re: json_encode()
| From: | Lars Strojny | Date: | Tue, 16 Dec 2008 07:39:52 +0000 |
| Subject: | Re: json_encode() | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-42280@lists.php.net to get a copy of this message | ||
Hi Rasmus,
Am Montag, den 15.12.2008, 14:17 -0800 schrieb Rasmus Lerdorf:
[...]
> There has to be a way to do a basic type without any sort of error or
> warning. E_STRICT, even if turned off, is slow. It ends up calling
> php_verror to construct the entire error string before it checks and
> sees that it isn't going to be written or displayed anywhere. That'd be
> another thing to look at eventually, of course, but for now, sprinkling
> the code with E_STRICT warnings in cases where there is a legitimate
> case for the usage, is a really bad idea.
I agree - with both the optimization and about making it possible to
encode scalars without any warning. So let's go with json_encode($value,
$encodeScalar = false), document it for 5.3 and throw a warning, if
json_encode(12, false) is called.
cu, Lars
--
Jabber: lars@strojny.net
Weblog: http://usrportage.de
Attachment: [application/pgp-signature] Dies ist ein digital signierter Nachrichtenteil signature.asc
Attachment: [application/pgp-signature] Dies ist ein digital signierter Nachrichtenteil signature.asc