Skip to content

Arginfo: add and use known strings for attributes #19075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

DanielEScherzer
Copy link
Member

No description provided.

@DanielEScherzer
Copy link
Member Author

This is the first part of my follow-up to #18780 dealing with reducing the work of registering attributes on constants (and other things) - here, if a string is known the known string is used for attribute name and values, and 8.0, 8.1, 8.2, 8.3, 8.4, and 8.5 are all added as known strings.


the same strings are allocated twice

It should probably be safe to just intern them all. They are always allocated on start-up, so the memory will be used either way. Interning should just reduce it, no?

Yes I agree.
If you pinky promise that you're gonna look at it before 8.5's release I'll allow it.

Originally posted by @nielsdos in #18780 (comment)

return $result;
}
$include = self::PHP_80_KNOWN;
switch ($minPhp) {
Copy link
Member

Choose a reason for hiding this comment

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

Why no match?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because gen_stub supports running on PHP 7.4, I have a todo to update that eventually

@TimWolla TimWolla removed their request for review July 9, 2025 06:28
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