Skip to content

Language: trait abstract residuals fatal at DECLARE after prior stmts (#25912) - #25922

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-25912-trait-abstract-unimplemented-fatal
Jul 31, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-25912-trait-abstract-unimplemented-fatal

Conversation

@PurHur

@PurHur PurHur commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • Keep class C { use Trait; } DECLARE opcodes in source order so preceding statements (e.g. echo "before") run before trait abstract residual checks — matches Zend bind timing (Zend/zend_inheritance.c zend_verify_abstract_class).
  • Raise abstract residuals as \CompileError and print via raiseClassDeclareCompileFatal (PHP Fatal error: on stderr, exit 255).
  • PHP-in-PHP only (lib/Compiler.php, lib/VM/ClassValidator.php, lib/VM.php); no new C.

Closes #25912

Test plan

  • Issue repro (Zend + VM):
./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_trait_abstract_unimplemented_fatal.php; php bin/vm.php test/repro/maintainer_gap_trait_abstract_unimplemented_fatal.php'

VM: stdout before; stderr PHP Fatal error: Class C contains 1 abstract method… (C::f); exit 255; no accepted.

  • vendor/bin/phpunit --filter TraitAbstractUnimplementedFatalTest — OK (2)
  • vendor/bin/phpunit --filter trait_abstract_unimplemented_fatal test/compliance/VMTest.php — OK (1)
  • Related: trait_abstract_const|trait_abstract_private_ok|enum_trait_abstract — OK (4)

Pre-claim gates: user_release_ready: yes; inventory OK; north-star5-fast ok.

Made with Cursor

…#25912)

Keep trait-using classes in source order and raise zend_verify_abstract_class
as E_COMPILE_ERROR on stderr so echo-before-class matches php-src.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 5dc5017 into master Jul 31, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-25912-trait-abstract-unimplemented-fatal branch July 31, 2026 11:07
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: unimplemented trait abstract method — fatal text/stream vs Zend (Zend/zend_compile.c)

1 participant