1
0
mirror of https://github.com/php/php-src.git synced 2026-04-18 13:31:27 +02:00
Files
archived-php-src/ext
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-01-01 13:15:04 +00:00
2012-01-01 13:15:04 +00:00
2012-01-01 13:15:04 +00:00
2012-01-01 13:15:04 +00:00
2012-01-01 13:15:04 +00:00
2012-01-01 13:15:04 +00:00
2012-01-01 13:15:04 +00:00
2012-01-01 13:15:04 +00:00
2012-06-06 12:10:00 +02:00
2012-06-23 20:51:52 +02:00
2012-01-01 13:15:04 +00:00
2012-01-01 13:15:04 +00:00
2012-01-01 13:15:04 +00:00
2012-05-16 14:28:55 +02:00
2012-05-16 14:28:55 +02:00
2012-06-22 17:32:46 +02:00
2012-04-19 12:47:09 +02:00
2012-01-01 13:15:04 +00:00
2012-06-22 17:32:46 +02:00
2012-01-01 13:15:04 +00:00
2012-01-01 13:15:04 +00:00
2012-06-22 17:32:46 +02:00
2012-06-23 15:10:47 -03:00
2012-06-22 17:32:46 +02:00
2012-01-01 13:15:04 +00:00
2012-01-01 13:15:04 +00:00
2012-01-15 00:07:26 +00:00
2012-06-22 17:32:46 +02:00
2012-01-01 13:15:04 +00:00
2012-01-01 13:15:04 +00:00
2012-01-01 13:15:04 +00:00
2012-01-01 13:15:04 +00:00
2012-01-01 13:15:04 +00:00
2012-01-01 13:15:04 +00:00
2012-01-01 13:15:04 +00:00
2012-06-19 17:15:56 +02:00