Skip to content

ext/opcache: minor refactoring (2026-03)#21397

Open
Girgias wants to merge 6 commits intophp:masterfrom
Girgias:opcache-minor-refactoring-2026-03
Open

ext/opcache: minor refactoring (2026-03)#21397
Girgias wants to merge 6 commits intophp:masterfrom
Girgias:opcache-minor-refactoring-2026-03

Conversation

@Girgias
Copy link
Member

@Girgias Girgias commented Mar 9, 2026

Commits should be reviewed in order.

@Girgias Girgias marked this pull request as ready for review March 9, 2026 19:15
@Girgias Girgias requested a review from dstogov as a code owner March 9, 2026 19:15
@Girgias Girgias requested a review from arnaud-lb March 9, 2026 19:15
Copy link
Member

@arnaud-lb arnaud-lb left a comment

Choose a reason for hiding this comment

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

Looks good to me apart from Tim's comment

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

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

Looks ok to me, apart from the comment made by Tim.

for (i = 0; i < entry->dependencies_count; i++) {
zend_class_entry *ce = zend_lookup_class_ex(entry->dependencies[i].name, NULL, 0);
for (uint32_t i = 0; i < entry->dependencies_count; i++) {
const zend_class_entry *dependent_ce = zend_lookup_class_ex(entry->dependencies[i].name, NULL, 0);
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Technically the name dependent_ce indicates a dependency of dependent_ce on ce, rather than the other way around.

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you have an idea for a better name? dependency_of_ce maybe?

Copy link
Member

Choose a reason for hiding this comment

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

Sure, or just dependency_ce.

Copy link
Member

@dstogov dstogov left a comment

Choose a reason for hiding this comment

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

I don't care about this.
If @iluuu1994 approves this, I don't object.

@Girgias Girgias force-pushed the opcache-minor-refactoring-2026-03 branch from ae63da1 to 964b903 Compare March 21, 2026 12:08
@Girgias Girgias requested review from TimWolla and iluuu1994 March 21, 2026 17:05
{
zend_file_handle ps_handle;
zend_string *full_path_ptr = NULL;
int ret;
Copy link
Member

Choose a reason for hiding this comment

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

Should be?

Suggested change
zend_result ret;

if (found && entry->dependencies) {
for (i = 0; i < entry->dependencies_count; i++) {
zend_class_entry *ce = zend_lookup_class_ex(entry->dependencies[i].name, NULL, ZEND_FETCH_CLASS_NO_AUTOLOAD);
const zend_class_entry *dependent_ce = zend_lookup_class_ex(entry->dependencies[i].name, NULL, ZEND_FETCH_CLASS_NO_AUTOLOAD);
Copy link
Member

Choose a reason for hiding this comment

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

Forgot to rename?

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.

5 participants