Skip to content

Conversation

@ndossche
Copy link
Member

By returning the stream directly, we avoid calling some helpers functions and it becomes more clear on what stream the code actually acts upon.

By returning the stream directly, we avoid calling some helpers
functions and it becomes more clear on what stream the code actually
acts upon.
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

Minor nit but LGTM and it is indeed more obvious what is happenning.

ext/phar/util.c Outdated
PHAR_G(cached_fp)[phar->phar_pos].fp = fp;
}

/* initialize a phar_archive_data's read-only fp for existing phar data */
Copy link
Member

Choose a reason for hiding this comment

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

Maybe clarify in the comment that the returned stream must not be closed/freed as it is owned by the phar?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah that's a good call. Done that now.

@ndossche ndossche merged commit 4f3c28a into php:master Dec 22, 2025
1 check passed
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