Skip to content

[PHP8.6] Misc parity: #[\Override] on class constants, __debugInfo() on enums, attribute API additions #225

Closed

Description

@lisachenko

Part of epic #219.

Features

Three smaller PHP 8.6 items with reflection surface, bundled into one ticket:

  1. #[\Override] allowed on class constants — attribute must be reflected on ReflectionClassConstant (incl. interface constants and enum constants). Follows the pattern of P7: Add #[\Override] test stubs and parity tests (PHP 8.3) #169 (8.3 #[\Override] on methods) and FileWithAttributedConstants85.php.
  2. __debugInfo() allowed on enums (Debuggable Enums RFC) — enums may now declare the __debugInfo magic method; ReflectionEnum/ReflectionClass::getMethods()/hasMethod() must reflect it like any method (previously a compile error, so untested).
  3. Attribute API additions — verify the final 8.6 status of ReflectionAttribute::getCurrent() (was in voting) and any other accepted Reflection* additions in the 8.6 beta; implement/inherit as appropriate in src/ReflectionAttribute.php or document why native inheritance suffices.

Scope

  • Stub files per feature (FileWithOverrideConstants86.php, enum-with-debugInfo stub) + parity tests guarded with PHP_VERSION_ID >= 80600, direct static assertions on 8.5.
  • AttributeResolverTrait coverage for constants with #[\Override] combined with other attributes.

Acceptance criteria

  • Static results match native reflection on 8.6 for all three items (or documented findings where a feature's final status changed in beta).
  • PHPUnit green on 8.5, PHPStan level 10 clean.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions