Skip to content

Conversation

@Girgias
Copy link
Member

@Girgias Girgias commented Dec 26, 2025

Commits should be reviewed in order

Part 1 of various refactoring relating to php_mail(), the main objective is to get rid of various strlen() recomputations when we already know the length of the strings.


if (PG(mail_x_header)) {
const char *tmp = zend_get_executed_filename();
const zend_string *tmp = zend_get_executed_filename_ex();
Copy link
Member

Choose a reason for hiding this comment

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

This is not equivalent because zend_get_executed_filename cannot return NULL while zend_get_executed_filename_ex can

Copy link
Member

Choose a reason for hiding this comment

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

Please revert this change, the extra complexity does not seem worth it. I doubt you're gonna feel the strlen() call here anyway. Furthermore I don't like to duplicate some of that logic here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done :)

@Girgias Girgias force-pushed the mail-refactor-part-1 branch from 49fc148 to b68179a Compare December 26, 2025 19:15
@Girgias Girgias requested a review from ndossche December 26, 2025 19:18

if (PG(mail_x_header)) {
const char *tmp = zend_get_executed_filename();
const zend_string *tmp = zend_get_executed_filename_ex();
Copy link
Member

Choose a reason for hiding this comment

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

Please revert this change, the extra complexity does not seem worth it. I doubt you're gonna feel the strlen() call here anyway. Furthermore I don't like to duplicate some of that logic here.

@Girgias Girgias force-pushed the mail-refactor-part-1 branch from b68179a to 2290aef Compare December 27, 2025 00:37
@Girgias Girgias requested a review from ndossche December 27, 2025 00:38
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