Skip to content

json_last_error_msg - better message - error position near by#18866

Closed
juan-morales wants to merge 13 commits into
php:masterfrom
juan-morales:json_last_error_msg/better-message
Closed

json_last_error_msg - better message - error position near by#18866
juan-morales wants to merge 13 commits into
php:masterfrom
juan-morales:json_last_error_msg/better-message

Conversation

@juan-morales
Copy link
Copy Markdown
Contributor

@juan-morales juan-morales commented Jun 16, 2025

Working POC giving a better error message when the json_last_error_msg function is called (only for this function).

Adding near character %d to a json related error message.

Putting aside my bad C coding skill, I would like to know your opinions on this PR, and kindly ask for reviews in order to improve it.

Thx in advance.

(@bukka I know you have been working on a new parser, but ... until that reaches the surface, could we go this way? (with the proper adjustments for sure)

@juan-morales juan-morales changed the title WIP - Json last error msg - better message - error position near by json_last_error_msg - better message - error position near by Jun 17, 2025
Copy link
Copy Markdown
Member

@DanielEScherzer DanielEScherzer left a comment

Choose a reason for hiding this comment

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

A few code style issues

Comment thread ext/json/json.c Outdated
Comment thread ext/json/json_parser.y Outdated
Comment thread ext/json/php_json_encoder.h Outdated
Comment thread ext/json/php_json_scanner.h Outdated
juan-morales and others added 3 commits June 20, 2025 08:32
Co-authored-by: DanielEScherzer <daniel.e.scherzer@gmail.com>
Comment thread ext/json/json.c Outdated
Comment thread ext/json/json_parser.y Outdated
Comment thread ext/json/json_scanner.re Outdated
@bukka
Copy link
Copy Markdown
Member

bukka commented Jul 30, 2025

It doesn't look like this addresses my coment in #14672 (review)

@juan-morales
Copy link
Copy Markdown
Contributor Author

OMG I totally forgot that @bukka , I will re do it, I just need to learn a little bit more

@juan-morales juan-morales deleted the json_last_error_msg/better-message branch December 1, 2025 13:10
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.

3 participants