* PHP-5.6:
Update NEWS and remove the unnecessary UPGRADING note.
UPGRADING and NEWS
Better test: Check combined leading/trailing
Fixed whitespace part of bug #64874 ("json_decode handles whitespace and case-sensitivity incorrectly")
* PHP-5.4:
Update NEWS and remove the unnecessary UPGRADING note.
UPGRADING and NEWS
Better test: Check combined leading/trailing
Fixed whitespace part of bug #64874 ("json_decode handles whitespace and case-sensitivity incorrectly")
Changed json_encode() so that when the JSON_PRETTY_PRINT option is specified,
the pair of linefeeds immediately after an opening bracket and before the
corresponding closing bracket is omitted when the array or object contains no
elements or accessible properties (and hence would have a blank line between
the brackets).
Following comment from Yoram "The patch looks fine, except of testing
for true value of utf16 in each iteration."
Also fix the length computation during check phase.
Json use an utf8 parser from a third party library, switch to
our implementation of php_next_utf8_char.
This also helps on solving #63520. All the unit tests succeed.
Our implementation also seems a little faster.
json.dsp need to be regenerated.
json_encode() no longer throws warnings. Instead only the error code for
json_last_error() is set.
As it is hard to debug the error from just an error code an optional
$as_string parameter was added to json_last_error(), which returns an
error message instead of an error code.
json_encode() now returns bool(false) for all possible errors, throws the
respective warning and also sets the respective json_last_error() error
code. Three new error codes have been added:
* JSON_ERROR_RECURSION
* JSON_ERROR_INF_OR_NAN
* JSON_ERROR_UNSUPPORTED_TYPE
To get a partial JSON output instead of bool(false) the option
JSON_PARTIAL_OUTPUT_ON_ERROR can be specified. In this case the invalid
segments will be replaced either by null (for recursion, unsupported type
and invalid JSON) or 0 (for Inf and NaN).
The warning for invalid UTF-8 stays intact and is thrown also with
display_errors = On. If this behavior is undesired this can be remedied
later.