Repository navigation
Conversation
|
Quoted below: written with Claude, an LLM, as CONTRIBUTING.md asks us to mark. The builds and test runs behind it are on my machine; the commands to repeat them are under the fold.
|
|
I think the change makes sense - it needs rebase though... |
A failure to escape an array or object key was ignored unless JSON_PARTIAL_OUTPUT_ON_ERROR was set, so encoding went on: later values still ran user code such as jsonSerialize(), and a later error replaced the one that was reported, e.g. a NAN value after an invalid UTF-8 key reported "Inf and NaN cannot be JSON encoded". Both key sites, the declared-property loop and the property table loop, now return FAILURE the same way a failed value does.
7a0db18 to
efa0ccf
Compare
When an array or object key failed to encode, json_encode() carried on with the remaining values unless JSON_PARTIAL_OUTPUT_ON_ERROR was set, so
jsonSerialize()still ran on later values and a later error could replace the one that caused the failure. Both key sites now bail out the same way a failed value already does; partial output is unchanged.