Commit Graph

11 Commits

Author SHA1 Message Date
Nikita Popov
b7903f9778 Revert JSON merges to 5.4
This reverts the following merge commits (-m 1):

405ebfcd18
d372b33c9b
36fa17a5fa
2012-07-01 16:38:26 +02:00
Nikita Popov
36fa17a5fa Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Improve json_encode error handling
  - BFN

Conflicts:
	ext/json/json.c
2012-06-23 21:14:45 +02:00
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
Sara Golemon
a0269a6a72 Ooops, return values... 2010-05-21 23:29:34 +00:00
Sara Golemon
6eb4218433 Add JSON_BIGINT_AS_STRING for json_decode() to parse large numbers
as strings rather than casting to double and loosing precision.
2010-05-21 22:59:58 +00:00
Scott MacVicar
87dbefa03b MFH: Add error constant when json_encode detects an invalid UTF-8 sequence. 2009-07-27 03:43:38 +00:00
Scott MacVicar
d2a7785878 MFH Allow a custom recursion depth to be specified for json_decode() 2009-05-14 22:02:08 +00:00
Scott MacVicar
fdf2d1e46f MFH Add json_last_error() for getting a bit of information about what failed during a decode, also fixes a segfault when we have [1}
[DOC]
2008-12-19 02:00:57 +00:00
Scott MacVicar
8ef7fe1d99 Update the JSON parser with that on json.org, biggest change here is code readability. Less magic numbers in the state table.
Add missing reflection information to json_encode()
Fixes bug #45791 with 0e0 not being supported as a value
Error values are stored when encountered during parsing
2008-12-17 14:40:06 +00:00
Ilia Alshanetsky
cdfe00b801 Fixed compiler warnings and enable Json by default. 2006-07-19 16:17:15 +00:00
SVN Migration
608baa409a This commit was manufactured by cvs2svn to create branch 'PHP_5_2'. 2006-05-05 15:49:42 +00:00