Bug #52397 [Opn->Bgs]: json_encode display_errors dependency
| From: | iliaa@php.net | Date: | Tue, 17 Aug 2010 12:29:53 +0000 |
| Subject: | Bug #52397 [Opn->Bgs]: json_encode display_errors dependency | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-153504@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52397&edit=1
ID: 52397
Updated by: iliaa@php.net
Reported by: david at grudl dot com
Summary: json_encode display_errors dependency
-Status: Open
+Status: Bogus
Type: Bug
Package: JSON related
PHP Version: 5.3.3RC3
Block user comment: N
New Comment:
The return values are the same and so is the operation...
Previous Comments:
------------------------------------------------------------------------
[2010-07-22 01:00:35] david at grudl dot com
Description:
------------
Invalid UTF-8 string throws E_WARNING depending on the configuration
directive display_errors:
ini_set('display_errors', 0);
json_encode("\xFF"); // PHP Warning: json_encode(): Invalid UTF-8
sequence in argument (in error log)
ini_set('display_errors', 1);
json_encode("\xFF"); // *nothing*
This directive determines whether errors should be printed to the screen
as part of the output or if they should be hidden from the user. It
should not be used to change json_encode behaviour.
The same bug affects htmlentities() and htmlspecialchars()
Test script:
---------------
ini_set('display_errors', 0);
json_encode("\xFF");
htmlspecialchars("\xFF", ENT_COMPAT, 'utf-8');
htmlentities("\xFF", ENT_COMPAT, 'utf-8');
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52397&edit=1