Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gen_stub: Add support for attributes on constants in stubs #18735

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

Merged
DanielEScherzer merged 4 commits into php:master from DanielEScherzer:constant-attribs-stubs
Jun 5, 2025

Conversation

Copy link
Member

@DanielEScherzer DanielEScherzer commented Jun 2, 2025

Update to PHP-Parser 5.5.0 and add support for attributes on constants in stubs. For now, I have only migrated over E_STRICT, once the support is in place I'll do a larger migration of the existing deprecated constants.

Update to PHP-Parser 5.5.0 and add support for attributes on constants in
stubs. For now, I have only migrated over E_STRICT, once the support is in
place I'll do a larger migration of the existing deprecated constants.
Copy link
Member

@kocsismate kocsismate left a comment
edited
Loading

Choose a reason for hiding this comment

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

LGTM once CI passes.

In order to fix the use-after-frees, you may try to set the attributes array to NULL inside free_zend_constant() after releasing it, otherwise freeing may be attempted again if the function is called again, since the value of the pointer remains non-NULL (but it refers to garbage).

E.g. function attributes are freed the same way:

function->common.attributes = NULL;

@DanielEScherzer DanielEScherzer merged commit 8f3cdf6 into php:master Jun 5, 2025
9 checks passed
TimWolla added a commit to TimWolla/php-src that referenced this pull request Jun 10, 2025
> PHP Warning: Undefined variable $code in build/gen_stub.php on line 5322
Introduced in php#18735.
TimWolla added a commit that referenced this pull request Jun 10, 2025
> PHP Warning: Undefined variable $code in build/gen_stub.php on line 5322
Introduced in #18735.
@DanielEScherzer DanielEScherzer deleted the constant-attribs-stubs branch July 24, 2025 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@kocsismate kocsismate kocsismate left review comments

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /