Skip to content
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

Implement ReflectionConstant #13669

Closed
wants to merge 2 commits into from
Closed

Conversation

iluuu1994
Copy link
Member

Fixes GH-13570

@iluuu1994 iluuu1994 changed the title Implement reflection constant Implement ReflectionConstant Mar 11, 2024
@nielsdos
Copy link
Member

Some reflection classes also have a name property, such that dumping it somewhere makes it easy to see what it refers to. Does it make sense to add it here too?

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.

Most Reflection classes implements Reflector and provide a __toString() method. I think that's useful and we could implement that for ReflectionConstant as well (using _const_string()).

ext/reflection/php_reflection.c Outdated Show resolved Hide resolved
ext/reflection/php_reflection.c Outdated Show resolved Hide resolved
ext/reflection/php_reflection.c Outdated Show resolved Hide resolved
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.

LGTM !

@kocsismate kocsismate mentioned this pull request Mar 17, 2024
@iluuu1994 iluuu1994 force-pushed the reflection-constant branch 2 times, most recently from 0f1ec56 to e99930c Compare March 20, 2024 10:44
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 nits, and maybe renaming const_ to const_ptr? I find the trailing underscore somewhat weird.

ext/reflection/php_reflection.c Show resolved Hide resolved
ext/reflection/php_reflection.c Show resolved Hide resolved
ext/reflection/php_reflection.stub.php Show resolved Hide resolved
@iluuu1994 iluuu1994 closed this in e23440e Apr 17, 2024
@staabm
Copy link
Contributor

staabm commented Apr 18, 2024

Thank you 🙏

TimWolla added a commit to TimWolla/php-src that referenced this pull request Apr 30, 2024
This is in preparation for php#11293 and for consistency with
ReflectionConstant::isDeprecated() that was added in php#13669.
TimWolla added a commit that referenced this pull request Apr 30, 2024
This is in preparation for #11293 and for consistency with
ReflectionConstant::isDeprecated() that was added in #13669.
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.

use reflection to determine whether a global constant is deprecated
9 participants