Fixed bug #64874 ("json_decode handles whitespace and case-sensitivity incorrectly") #457
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the JSON parser's handling of top-level primitives. Specifically, it fixes whitespace (previously
"[true] "
decoded fine but" true"
didn't), and case (previously"tRue"
decoded fine and[tRue]
did not, however both are RFC non-compliant). This is a tiny change, but because of the very unlikely case that there was PHP code relying on deserialising strings like"Null"
, despite RFC non-compliance and no JSON serialisers outputting it, I must classify this as "backwards-incompatible". Hence, this should be merged into master and hopefully PHP 5.6.I have a separate request which is the backwards-compatible half of this request that only fixes the whitespace issue. It is supposed to be merged into PHP 5.4 and PHP 5.5, since it is a non-backwards-incompatible bug fix: #456EDIT: The backwards-compatible portion is now into 5.4, 5.5 and master. Hence this request now purely concerns the case-sensitivity portion.