note 114846 added to function.json-last-error-msg
| From: | seregynp at gmail dot com | Date: | Sun, 13 Apr 2014 13:26:58 +0000 |
| Subject: | note 114846 added to function.json-last-error-msg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-199262@lists.php.net to get a copy of this message | ||
Watch out !
In case no error occurred, 'No error' still returned !
So when upgrading to php 5.5, unexpected behavior can be:
<?php
if ($error = json_last_error_msg()) {
throw new \LogicException(sprintf("Failed to parse json string '%s', error:
'%s'", $this->data, $error));
}
// in php 5.5 exception will be thrown, while as in older version not
?>
----
Server IP: 72.52.91.14
Probable Submitter: 37.55.35.142
----
Manual Page -- http://php.net/manual/en/function.json-last-error-msg.php
Edit -- https://master.php.net/note/edit/114846
Del: integrated -- https://master.php.net/note/delete/114846/integrated
Del: useless -- https://master.php.net/note/delete/114846/useless
Del: bad code -- https://master.php.net/note/delete/114846/bad+code
Del: spam -- https://master.php.net/note/delete/114846/spam
Del: non-english -- https://master.php.net/note/delete/114846/non-english
Del: in docs -- https://master.php.net/note/delete/114846/in+docs
Del: other reasons-- https://master.php.net/note/delete/114846
Reject -- https://master.php.net/note/reject/114846
Search -- https://master.php.net/manage/user-notes.php