Skip to content

Language: parent:: and static:: resolution in extends chain (#1858) - #1883

Merged
PurHur merged 2 commits into
masterfrom
issue-1858-parent-static-resolution
May 25, 2026
Merged

PurHur merged 2 commits into
masterfrom
issue-1858-parent-static-resolution

Conversation

@PurHur

@PurHur PurHur commented May 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • VM: Fix declaringClassLc() (class->value); resolve parent::method() to parent class with implicit $this for instance methods; static:: uses called-class LSB; runtime reject parent::class.
  • Compiler: Compile-time reject parent::class when scope resolves to parent.
  • JIT: parent scope via setClassParentName / resolveJitStaticScopeClass; implicit $this for parent instance dispatch.
  • Tests: Compliance PHPTs for parent::greet(), override + parent, static::make(); unit test for parent::class rejection.
  • Docs: Regenerated capabilities-syntax.md / capabilities.md LSB note (Language: parent:: and static:: resolution in extends chain (#101 phase 1b) #1858). Spine canonical 585/588 sync (test + footnotes).

Notes

Test plan

  • ./script/docker-ci-local.sh fast (doc gates + MiniWebApp lint/VM CLI)
  • PHPUnit: ParentStaticScopeTest, parent_method_call, extends_method_override, static_late_binding_factory
  • Full ./script/docker-ci-local.sh (LLVM) before merge if required on maintainer host

Closes #1858

Made with Cursor

VM/JIT resolve parent::method() to the parent vtable with implicit $this
for instance methods; static:: uses called-class LSB. Compiler rejects
parent::class at compile time; VM rejects parent::class at runtime.
Add compliance PHPTs and sync capability docs. Bump spine canonical count
to 585 (BootstrapSelfhostBundleTest + roadmap footnotes).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur force-pushed the issue-1858-parent-static-resolution branch from f5d0cad to 408c336 Compare May 25, 2026 03:28
**589/593** did not satisfy check-wave3 hasSpine (**589**); use **589** / **593**.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Language: parent:: and static:: resolution in extends chain (#101 phase 1b)

1 participant