1
0
mirror of https://github.com/php/php-src.git synced 2026-04-04 14:42:49 +02:00
Files
archived-php-src/ext/json/tests
Nikita Popov 84fe2cc890 Improve json_encode error handling
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.
2012-06-23 20:51:52 +02:00
..
2012-06-23 20:51:52 +02:00
2012-06-23 20:51:52 +02:00
2007-12-28 13:23:00 +00:00
2007-04-26 23:30:00 +00:00
2007-04-16 09:11:10 +00:00
2007-06-29 13:51:27 +00:00
2007-06-29 14:00:21 +00:00
2008-11-19 16:58:28 +00:00
2007-10-01 15:33:11 +00:00
2009-03-17 23:31:14 +00:00
2009-01-08 14:09:49 +00:00