php / php/php-src

ext/reflection: Add `getFqn()` method to `ReflectionClass`, `ReflectionConstant`, `ReflectionFunctionAbstract`, and `ReflectionAttribute`

Open
#19,558 0 comments 0 reactions 1 assignee View on GitHub

@DanielEScherzer is already working on this.

Since Aug 23, 2025.

Extension: reflection Feature
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

The getName() method on those classes returns a qualified name rather than the fully qualified name.

There are various instances where just a qualified name is not sufficient (e.g. documentation or code gen), and while it is very easy to get the FQN by just prepending \ to the name from getName() this is something that needs to be known to be safe to do.

This maybe also should be added to ReflectionClassConstant as methods would also have this new method automatically due to ReflectionMethod inheriting from ReflectionFunctionAbstract.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.