Skip to content

PHP 8.5 feature-support audit: harness and fixtures - #597

Merged
lisachenko merged 12 commits into
masterfrom
claude/php85-framework-audit-js2kzq
Aug 29, 2026
Merged

PHP 8.5 feature-support audit: harness and fixtures#597
lisachenko merged 12 commits into
masterfrom
claude/php85-framework-audit-js2kzq

Conversation

@lisachenko

@lisachenko lisachenko commented Aug 28, 2026

Copy link
Copy Markdown
Member

PHP 8.5 feature-support audit

Audit branch: harness + fixtures that weave PHP 8.0–8.5 feature constructs through the real WeavingTransformer and 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

  • Pipe operator |> in woven method bodies
  • clone with
  • #[\NoDiscard] (copied to proxy; join-point dispatch preserves the value path)
  • Attributes on class constants, incl. #[\Deprecated]
  • Closures / first-class callables as parameter defaults (support merged earlier)
  • final promoted properties and static asymmetric visibility on non-intercepted properties
  • self/parent reflection resolution

Confirmed gaps → filed issues

Issue Bug Feature since
#598 Class-level attributes break class→trait conversion (parse error) 8.0
#599 Promoted ctor properties × property interception → broken constructor 8.0/8.4
#600 Enum proxies lose constant-expression case values (fatal) 8.1
#601 Non-scalar / closure attribute arguments crash proxy generation 8.1/8.5
#602 Global constants in attribute args crash weaving (upstream parser-reflection) 8.0
#603 ConstructorExecutionTransformer rewrites new in constant expressions (fatal) 8.1

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.php weaves every fixture in tests/Fixtures/audit/src/ with an intercept-everything advice matcher (mirroring real AdviceMatcher gates) and lints all outputs. Confirmed-broken fixtures are pinned in KNOWN_GAPS with 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).

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
claude added 2 commits August 28, 2026 21:09
- 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
Comment thread composer.json Outdated
claude added 3 commits August 28, 2026 21:31
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
claude added 4 commits August 28, 2026 21:54
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
Comment thread tests/Stubs/Collaborator.php
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
lisachenko marked this pull request as ready for review August 29, 2026 08:43
@lisachenko
lisachenko merged commit 71690ca into master Aug 29, 2026
8 checks passed
@lisachenko
lisachenko deleted the claude/php85-framework-audit-js2kzq branch August 29, 2026 08:44
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants