Skip to content

ext/intl: Reset IntlListFormatter error state in constructor - #22931

Merged
LamentXU123 merged 1 commit into
php:PHP-8.5from
LamentXU123:ext-intl
Aug 1, 2026
Merged

ext/intl: Reset IntlListFormatter error state in constructor#22931
LamentXU123 merged 1 commit into
php:PHP-8.5from
LamentXU123:ext-intl

Conversation

@LamentXU123

Copy link
Copy Markdown
Member

When reading the code base, I found the construct method in IntlListFormatter doesn't reset the error state.

@LamentXU123

Copy link
Copy Markdown
Member Author

@devnexen ping :) cuz I need this to be reviewed to continue my work about refactoring the error state.

@LamentXU123
LamentXU123 merged commit 94d00c9 into php:PHP-8.5 Aug 1, 2026
18 checks passed
LamentXU123 added a commit that referenced this pull request Aug 1, 2026
* PHP-8.5:
  ext/intl: Reset IntlListFormatter error state in constructor (#22931)
LamentXU123 added a commit that referenced this pull request Aug 2, 2026
Introduce PHP_INTL_FUNCTION_WITH_ERROR_RESET macro to standardize
and automate the global Intl error state reset at the start of
every userland PHP_FUNCTION. Also change the IC_METHOD function
to automatically reset error state in the start of the defined function.

The macro wraps the function entry point, performs
intl_error_reset(NULL), and delegates the actual logic to a
separate _impl function. This reduces boilerplate and prevents
bugs caused by missing error resets, as seen in GH-22931 and
GH-22500.

This refactor applies to all functions with a manual reset call
and does not affect internal helper functions that handle errors
independently.
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.

2 participants