Skip to content

json_last_error_msg - better message - error position near by #18866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
code style fixes
  • Loading branch information
juan-morales committed Jun 20, 2025
commit 7255a81f5004703e6517b374b8cd98994118dc80
3 changes: 1 addition & 2 deletions ext/json/json_parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,7 @@ PHP_JSON_API void php_json_parser_init_ex(php_json_parser *parser,
int options,
int max_depth,
const php_json_parser_methods *parser_methods)
{

{
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{
{
memset(parser, 0, sizeof(php_json_parser));
php_json_scanner_init(&parser->scanner, str, str_len, options);
parser->depth = 1;
Expand Down
4 changes: 2 additions & 2 deletions ext/json/php_json_scanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ typedef struct _php_json_scanner {
php_json_ctype *limit; /* the last read character + 1 position */
php_json_ctype *marker; /* marker position for backtracking */
php_json_ctype *ctxmarker; /* marker position for context backtracking */
php_json_ctype *str_start; /* start position of the string */
php_json_ctype *input_start; /* start position of the string */
php_json_ctype *str_start; /* dynamic position of the string under analysis */
php_json_ctype *input_start; /* fixed start position of the original string provided to the scanner */
php_json_ctype *pstr; /* string pointer for escapes conversion */
zval value; /* value */
int str_esc; /* number of extra characters for escaping */
Expand Down
Loading