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

General policy in PHP as far as I know is that non-OO functions do not do exceptions.

return nearly everything scalar we have (boolean, string, null,
integer,...) we can't use our normal "returns FALSE on failure".

This function can return only a string, but I'm not sure returning false if somewhere in some value deep down your data is some bad utf-8 is warranted. It is doable, though, but I'm afraid most of current code never check for return of json_encode() so they are in for big surprises when json_encode won't produce valid JSON.
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to