Repository navigation
Language: Zend null-default typed property fatal suggests ?T (#31820) - #31827
Merged
Merged
Conversation
Match zend_compile.c wording for non-nullable property defaults of null; keep ?T = null accepted. Guard with dedicated VM/JIT compliance cases. Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur
added a commit
that referenced
this pull request
Aug 17, 2026
…ollow-up) #31827 matched Zend’s message text but still printed parseAndCompile failure. Pass property source location so CLI shows PHP Fatal error: like zend_compile.c. Co-authored-by: Cursor <cursoragent@cursor.com>
2 tasks done
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.
Summary
Zend/zend_compile.cfatal forpublic T $prop = nullon non-nullable typed properties: suggest?T.Cannot use …path;?int $x = nullstill compiles.php-src reference
Zend/zend_compile.c— typed property default null check (“Use the nullable type ?%s …”)lib/Compiler.php(throwTypedDefaultMismatch)Test plan
./script/phpunit.sh --filter TypedPropNullDefaultFatal31820(VM + JIT)Verification
Not covered: full
VMTest/JITTestsuites; union-type null defaults (still early-return in assert path).Made with Cursor