Skip to content

json: Store errors in a structured fashion#22421

Open
TimWolla wants to merge 1 commit into
php:masterfrom
TimWolla:json-error-position-handling
Open

json: Store errors in a structured fashion#22421
TimWolla wants to merge 1 commit into
php:masterfrom
TimWolla:json-error-position-handling

Conversation

@TimWolla

Copy link
Copy Markdown
Member

This will make it both easier to consume the error information and reduce the chance for mistakes when settings errors, because not every field will need to be set manually.

The functions that have been removed as part of this change were added in master only, thus removing those is not an API change between the latest stable (PHP 8.5) and this PR.

Fixes #22420.

This will make it both easier to consume the error information and reduce the
chance for mistakes when settings errors, because not every field will need to
be set manually.

The functions that have been removed as part of this change were added in
master only, thus removing those is not an API change between the latest stable
(PHP 8.5) and this PR.

Fixes php#22420.
@TimWolla TimWolla force-pushed the json-error-position-handling branch from c261ab5 to 205cd4b Compare June 24, 2026 09:25

@Girgias Girgias left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me, just a minor nit.

Comment thread ext/json/php_json.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

json_encode() errors don't clear the error position

2 participants