note 117023 added to function.json-encode
| From: | Goran | Date: | Fri, 03 Apr 2015 07:00:22 +0000 |
| Subject: | note 117023 added to function.json-encode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-202155@lists.php.net to get a copy of this message | ||
This function has weird behavior regarding error reporting in PHP version 5.4 or lower. This kind of
warning is raised only if you configure PHP with "display_errors=Off" (!?): "PHP
Warning: json_encode(): Invalid UTF-8 sequence in argument ..."
You can reproduce this behavior:
<?php
// Warning not displayed, not logged
ini_set('display_errors', '1');
json_encode(urldecode('bad utf string %C4_'));
// Warning not displayed but logged
ini_set('display_errors', '0');
json_encode(urldecode('bad utf string %C4_'));
?>
This is considered feature - not-a-bug - by PHP devs:
https://bugs.php.net/bug.php?id=52397
https://bugs.php.net/bug.php?id=63004
----
Server IP: 72.52.91.14
Probable Submitter: 212.92.200.41
----
Manual Page -- http://php.net/manual/en/function.json-encode.php
Edit -- https://master.php.net/note/edit/117023
Del: integrated -- https://master.php.net/note/delete/117023/integrated
Del: useless -- https://master.php.net/note/delete/117023/useless
Del: bad code -- https://master.php.net/note/delete/117023/bad+code
Del: spam -- https://master.php.net/note/delete/117023/spam
Del: non-english -- https://master.php.net/note/delete/117023/non-english
Del: in docs -- https://master.php.net/note/delete/117023/in+docs
Del: other reasons-- https://master.php.net/note/delete/117023
Reject -- https://master.php.net/note/reject/117023
Search -- https://master.php.net/manage/user-notes.php