Skip to content

Conversation

@nikic
Copy link
Member

@nikic nikic commented May 29, 2020

Instead of passing format and va_args, pass a preformatted zend_string. This saves every user from doing the formatting themselves, often multiple times. It also allows reusing the same message, instead of duplicating it in various places.

cc @beberlei. This is inspired by #4555, as I really don't like that adding another place where we pass format/args and force people do another formatted print.

@nikic
Copy link
Member Author

nikic commented May 29, 2020

This is not quite right due to the way last_error_message is managed. We probably shouldn't be setting it when outside a request.

nikic added 3 commits May 29, 2020 12:18
Export a zend_error_zstr API for that purpose.
Avoid leaking the last error between persistent and per-request
phases.
@nikic nikic force-pushed the error-format-cleanup branch from 9140665 to 186a6a9 Compare May 29, 2020 10:33
@nikic nikic closed this May 29, 2020
@nikic nikic reopened this May 29, 2020
Copy link
Contributor

@beberlei beberlei left a comment

Choose a reason for hiding this comment

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

This is a nice cleanup, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants