You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[EPIC] PHP 8.6 support — full reflection parity #219
Bring goaop/parser-reflection to full parity with PHP 8.6 (GA planned for 2026-11-19, currently in beta). This epic tracks all PHP 8.6 features that affect static reflection, following the same approach used for the 8.4/8.5 cycles (#162, #209).
Context
Master targets PHP 8.5+; CI already runs an experimental (allowed-to-fail) PHP 8.6 job in .github/workflows/phpunit.yml.
ReflectionEngine parses with PHP-Parser's newest supported grammar by default, so new 8.6 syntax support arrives via nikic/php-parser upgrades (currently ^5.4, latest is 5.8.0 which does not yet parse the 8.6 partial-application ? placeholder).
Runtime-parity tests against native reflection must be guarded with PHP_VERSION_ID >= 80600 where they exercise 8.6-only behavior, mirroring the existing per-feature stub pattern (tests/Stub/FileWith*85.php → FileWith*86.php).
PHP 8.6 features in scope (accepted/implemented RFCs)
Feature
Reflection impact
Sub-issue
Function parameter doc comments
ReflectionParameter::getDocComment() must be emulated from AST
TBD
ReflectionProperty::isReadable() / isWriteable()
New methods to emulate statically (visibility, asymmetric visibility, readonly, hooks)
8.6 deprecations (is_double()/is_integer()/is_long(), return from finally, etc.) + test scaffolding
Library must run deprecation-clean on 8.6; shared 8.6 stub/guard infrastructure
TBD
Out of scope (no reflection surface): clamp(), SortDirection enum, Time\Duration, polling API, pack/unpack endianness modifiers, session/security defaults, closure performance optimizations.
Delivery process
Each sub-issue is implemented on its own branch in an isolated worktree by a dedicated agent (max 4 in parallel) and lands as a separate PR referencing its sub-issue.
PRs are reviewed by the orchestrating session; final accept/merge stays with @lisachenko.
Definition of done per sub-issue: implementation + stubs + parity tests green on PHP 8.5 (and on the 8.6 experimental job where the runtime allows), PHPStan level 10 clean.
All seven sub-issues are merged and closed — closing the epic. 🎉 Below is a ready-to-paste release-notes draft in the 4.0.0 style. One decision is yours: the version number — semver continuation says 5.0.0 (the PHP ≥8.5 requirement from #218 is a major break after 4.0.0), while the branch-alias: 8.5-dev in composer.json suggests PHP-aligned 8.5.0; the draft uses X.Y.0.
Parser Reflection X.Y.0
This release brings the library to full PHP 8.6 reflection parity ahead of the PHP 8.6 GA (planned 2026-11-19): parameter doc comments, scope-aware property accessibility, readonly property defaults, partial function application, and the 8.6 attribute-API additions are all reflected statically from the AST — without loading the reflected code into memory. All 8.6 behavior is validated against PHP 8.6.0RC2 and guarded by runtime version checks, so the library runs identically on PHP 8.5. Tracked in epic #219.
💥 Breaking changes
PHP 8.5 or newer is now required (previously >=8.4) — chore!: master now targets PHP 8.5+ only #218. The CI matrix runs PHP 8.5 (lowest + highest deps) with PHP 8.6 as experimental.
ReflectionParameter::getDocComment() — doc comments on parameters (plain, promoted, variadic, by-ref, combined with attributes), byte-for-byte native parity; available on every supported runtime. Known limitation: a doc comment written after a parameter is dropped by PHP-Parser — [PHP8.6] ReflectionParameter::getDocComment() — parameter doc comments #221
ReflectionProperty::isReadable() / isWritable() — scope-aware accessibility emulation covering visibility, asymmetric (set) visibility, readonly (incl. the implicit protected(set)), property hooks, virtual properties, and object initialization state; validated against native 8.6 across ~12,800 combinations. Deliberate divergence: scope classes are resolved statically, never autoloaded — [PHP8.6] ReflectionProperty::isReadable() / isWriteable() emulation #222
Readonly property defaults — hasDefaultValue() / getDefaultValue() / getDefaultProperties() for readonly properties with defaults, verified against PHP 8.6.0RC2 across scalar, const-expression, class-constant, enum-case and array defaults — [PHP8.6] Readonly property default values #223
Dev dependencies: phpunit/phpunit ^13.3, rector/rector ^2.6.7 (required: Rector preloads its bundled php-parser under PHPUnit ≥ 12, so the bundle must also be ≥ 5.9)
Known follow-ups (out of this release's scope): #233, #234, #235, and possibly mirroring the new 8.6 getDefaultValue() deprecation in the parsed implementation.
Activity
lisachenko commentedon Sep 23, 2026
All seven sub-issues are merged and closed — closing the epic. 🎉 Below is a ready-to-paste release-notes draft in the 4.0.0 style. One decision is yours: the version number — semver continuation says 5.0.0 (the PHP ≥8.5 requirement from #218 is a major break after 4.0.0), while the
branch-alias: 8.5-devin composer.json suggests PHP-aligned 8.5.0; the draft usesX.Y.0.Parser Reflection X.Y.0
This release brings the library to full PHP 8.6 reflection parity ahead of the PHP 8.6 GA (planned 2026-11-19): parameter doc comments, scope-aware property accessibility, readonly property defaults, partial function application, and the 8.6 attribute-API additions are all reflected statically from the AST — without loading the reflected code into memory. All 8.6 behavior is validated against PHP 8.6.0RC2 and guarded by runtime version checks, so the library runs identically on PHP 8.5. Tracked in epic #219.
💥 Breaking changes
>=8.4) — chore!: master now targets PHP 8.5+ only #218. The CI matrix runs PHP 8.5 (lowest + highest deps) with PHP 8.6 as experimental.nikic/php-parser: ^5.9is now required — the first release parsing PHP 8.6 partial-application placeholders (ArgPlaceholder) — [PHP8.6] Partial Function Application — parsing & reflection support (blocked on PHP-Parser) #224ReflectionAttribute::getArguments(), matching native reflection (previously they were collapsed into a positional list) — [PHP8.6] Misc parity: #[\Override] on class constants, __debugInfo() on enums, attribute API additions #225ReflectionClassConstant::__toString()now prints the constant's doc comment like native reflection, and renders boolean values astrue/falseon PHP 8.6+ (following the native rendering change) — [PHP8.6] Misc parity: #[\Override] on class constants, __debugInfo() on enums, attribute API additions #225, [PHP8.6] Readonly property default values #223✨ PHP 8.6 API coverage
ReflectionParameter::getDocComment()— doc comments on parameters (plain, promoted, variadic, by-ref, combined with attributes), byte-for-byte native parity; available on every supported runtime. Known limitation: a doc comment written after a parameter is dropped by PHP-Parser — [PHP8.6] ReflectionParameter::getDocComment() — parameter doc comments #221ReflectionProperty::isReadable()/isWritable()— scope-aware accessibility emulation covering visibility, asymmetric(set)visibility,readonly(incl. the implicitprotected(set)), property hooks, virtual properties, and object initialization state; validated against native 8.6 across ~12,800 combinations. Deliberate divergence: scope classes are resolved statically, never autoloaded — [PHP8.6] ReflectionProperty::isReadable() / isWriteable() emulation #222hasDefaultValue()/getDefaultValue()/getDefaultProperties()forreadonlyproperties with defaults, verified against PHP 8.6.0RC2 across scalar, const-expression, class-constant, enum-case and array defaults — [PHP8.6] Readonly property default values #223f(?),f(name: ?)andf(1, ...)reflect cleanly on every host runtime; placeholder arguments in constant-expression positions degrade into a catchableReflectionException(the same contract as first-class callables) — [PHP8.6] Partial Function Application — parsing & reflection support (blocked on PHP-Parser) #224ReflectionAttribute::getShortName(),getNamespaceName(),inNamespace()andReflectionConstant::inNamespace()implemented (the inherited native implementations fatal on parsed attributes) — [PHP8.6] Misc parity: #[\Override] on class constants, __debugInfo() on enums, attribute API additions #225#[\Override]on class constants (incl. interface and enum constants) and__debugInfo()on enums are fully reflected — [PHP8.6] Misc parity: #[\Override] on class constants, __debugInfo() on enums, attribute API additions #225strcoll()et al.) reportisDeprecated()and their#[\Deprecated]payload correctly through the native fallback — PHP 8.6: internal functions gaining #[\Deprecated] (e.g. strcoll()) should be reflected correctly #215🐛 Bug fixes
getDefaultValueExpression()on typed properties/parameters without a default value — [PHP8.6] Readonly property default values #223isVirtual()no longer misreports a property whose short-formgethook references its own backing store — [PHP8.6] ReflectionProperty::isReadable() / isWriteable() emulation #222🔧 Internal & CI
FileWith*86.phpstub convention withPHP_VERSION_ID >= 80600guards) and a deprecation-clean audit against the "Deprecations for PHP 8.6" RFC (no hits) — [PHP8.6] Test scaffolding for 8.6 + deprecation-clean audit #220phpunit/phpunit ^13.3,rector/rector ^2.6.7(required: Rector preloads its bundled php-parser under PHPUnit ≥ 12, so the bundle must also be ≥ 5.9)Full Changelog: 4.0.0...X.Y.0
Known follow-ups (out of this release's scope): #233, #234, #235, and possibly mirroring the new 8.6
getDefaultValue()deprecation in the parsed implementation.Generated by Claude Code