PHP 8.5 feature-support audit: harness and fixtures - #597
Merged
Conversation
Temporary audit-branch artifacts: weaves PHP 8.1-8.5 feature fixtures (pipe operator, clone-with, closures in constant expressions, attributes on constants, #[NoDiscard], final promoted properties, static asymmetric visibility, enum const-expr cases, non-scalar attribute args, new in initializers) through the real WeavingTransformer and lints the woven trait and generated proxy. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WFMYyvE4hYRUoMS8mtKrHP
This was referenced Aug 28, 2026
Closed
Closed
Closed
- Move audit fixtures to tests/Fixtures/audit/src (Go\Tests\Audit) so the functional test project is not polluted by intentionally-broken inputs (one poisoned file aborted debug:advisor for the whole project) - One class per file so the parser-reflection locator can resolve them - Add isolation fixtures: class-level attribute on plain class, global constant in attribute argument - Harness now asserts KNOWN_GAPS (issues #598-#603): a fixture that weaves+lints cleanly is asserted to stay clean; a known-broken one must stay broken until its fix PR removes the entry Audit results (PHP 8.4 / 8.5.10 / 8.6.0beta2): pipe operator, clone-with, NoDiscard, attributes on constants, closure param defaults all weave cleanly; class-level attributes (#598), promoted-property interception (#599), enum const-expr cases (#600), non-scalar attribute args (#601), global consts in attr args (#602) confirmed broken; suite otherwise green on all three PHP versions, phpstan level 10 clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WFMYyvE4hYRUoMS8mtKrHP
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WFMYyvE4hYRUoMS8mtKrHP
lisachenko
commented
Aug 28, 2026
Relocate the audit stub classes from a dedicated tests/Fixtures/audit root into tests/Stubs/Audit, which is covered by the existing Go\ autoload mapping, and drop the extra composer.json autoload-dev entry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WFMYyvE4hYRUoMS8mtKrHP
The attribute-arguments fix (PR #611) resolves the non-scalar and global-constant attribute argument gaps. Php81NonScalarAttributeArgs and Php85ClosuresInConstExpr still fail on their class-level attributes, which is issue #598, so they stay pinned to that issue; Php80GlobalConstAttrArg now weaves cleanly and is asserted to stay clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WFMYyvE4hYRUoMS8mtKrHP
Class-level attributes, promoted-property interception and new-in-const-expr guards are fixed, so those fixtures are asserted clean now. The fixes exposed two narrower follow-ups, reported as #615 (#[Attribute] classes cannot be woven into traits) and #616 (new-in-initializer default copied onto the proxy hook property), and pinned here. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WFMYyvE4hYRUoMS8mtKrHP
PHP only rejects #[Attribute] on a trait at compile time since 8.5, so the attribute-class fixtures weave cleanly on 8.4 and fatal on 8.5+. Assert the version-specific behavior explicitly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WFMYyvE4hYRUoMS8mtKrHP
… clean Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WFMYyvE4hYRUoMS8mtKrHP
lisachenko
commented
Aug 29, 2026
Drop the Audit sub-namespace: the stub classes live directly in tests/Stubs (Go\Stubs), and the harness selects them by explicit list instead of globbing the directory. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WFMYyvE4hYRUoMS8mtKrHP
lisachenko
marked this pull request as ready for review
August 29, 2026 08:43
lisachenko
pushed a commit
that referenced
this pull request
Aug 29, 2026
The audit branch (#597) merged with KNOWN_GAPS still pinning #615/#616, which this branch fixes — empty the gap list so the harness asserts the fully-fixed state. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WFMYyvE4hYRUoMS8mtKrHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PHP 8.5 feature-support audit
Audit branch: harness + fixtures that weave PHP 8.0–8.5 feature constructs through the real
WeavingTransformerand lint the woven trait and generated proxies. Run on PHP 8.4, 8.5.10, and 8.6.0beta2 — results identical across versions (nothing is 8.5-runtime-specific; no 8.6-specific breakage found anywhere in the suite).Verified working on PHP 8.5
|>in woven method bodiesclone with#[\NoDiscard](copied to proxy; join-point dispatch preserves the value path)#[\Deprecated]finalpromoted properties and static asymmetric visibility on non-intercepted propertiesself/parentreflection resolutionConfirmed gaps → filed issues
ConstructorExecutionTransformerrewritesnewin constant expressions (fatal)Enhancements/docs/modernization: #604 (pointcut expressiveness), #605 (php85-limitations docs), #606 (native lazy objects), #607 (property hooks internally), #608 (typed constants +
#[\Override]), #609 (array_any/find + latent strpos bugs), #610 (process/cleanup).How the harness works
tests/Instrument/Transformer/Php85AuditScratchTest.phpweaves every fixture intests/Fixtures/audit/src/with an intercept-everything advice matcher (mirroring realAdviceMatchergates) and lints all outputs. Confirmed-broken fixtures are pinned inKNOWN_GAPSwith their issue link: CI stays green, and once a fix PR lands, the corresponding entry must be removed (the harness fails loudly when a known gap starts passing).Fix work
Fixes are being prepared as separate PRs per workstream (attribute AST fidelity; weaving-transformer token fixes; enum/pointcuts/docs; modernization batch).