Skip to content

Add ReflectionConstant::getExtension() #16571

Closed

Description

@vudaltsov

Description

Very happy to see ReflectionConstant in PHP 8.4.

I would like to propose adding ReflectionConstant::getExtensionName(): false|string and ReflectionConstant::getExtension(): ?ReflectionExtension as in ReflectionClass and ReflectionFunction.

Currently to get constant's extension one has to parse get_defined_constants(categorize: true).

Activity

  1. DanielEScherzer commented on Oct 25, 2024

    @DanielEScherzer
    Member

    Makes sense, and should be relatively easy given that we already store the module number in the constant flags. But I am confused by

    I would like to propose adding ReflectionConstant::getExtensionName(): false|string and ReflectionConstant::getExtensionName(): ?ReflectionExtension

    this is proposing the same method twice, with different signatures?

  2. vudaltsov commented on Oct 25, 2024

    @vudaltsov
    ContributorAuthor

    this is proposing the same method twice, with different signatures?

    Ooops, that's a typo. I meant ReflectionConstant::getExtensionName(): false|string and ReflectionConstant::getExtension(): ?ReflectionExtension. Fixed in the first message as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions