On Thu, Jun 21, 2012 at 4:12 PM, Daniel Convissor
<dani...@analysisandsolutions.com> wrote:
> Hi Nikita:
>
>> PHP <= 5.3.13, PHP 5.4, master behave as follows when an invalid UTF-8
>> string is encountered:
>>  * A warning is thrown, but only if display_errors=off
>
> So the warning is put into the error log?  But only if display_errors is
> off?  And if display_errors is on, no warning is produced?
>
> That's very counter-intuitive and un-PHP-like.  Someone mentioned it's for
> security reasons.  By that logic, we should get rid of all error
> messages because they all reveal some information that can be used by
> attackers.

Yes, I agree with this, but other people thing differently about it ;)

Personally I'd actually remove the warning completely with the return
false behavior. The return value makes clear that there was an error
and json_last_error() can be used to determine what exactly went
wrong. The warning seems redundant in this case and could actually
make the use more complicated.

Nikita

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

Reply via email to