Repository navigation
steins-infer: PHP's compile-time return fatals are return.compile-fatal (#952, #1051 S3) - #1059
Merged
Merged
Conversation
zonuexe
force-pushed
the
claude/ta-s3-compile-fatal-returns
branch
from
October 11, 2026 08:16
b256c37 to
30e20e6
Compare
zonuexe
force-pushed
the
claude/ta-s3-compile-fatal-returns
branch
from
October 11, 2026 09:24
30e20e6 to
dfe3811
Compare
zonuexe
marked this pull request as ready for review
October 11, 2026 09:30
This was referenced Oct 11, 2026
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.
Slice S3 of the type/arity reproduction run (#1051). Fixes #952 k1/k2: PHP's three compile-time return fatals are now reported under one new Proof/Default id,
return.compile-fatal(decision D5).What changed
steins-syntax): a scope lists its return statements with the form PHP's compiler tells apart: bare, valued, or arrow body. The list is read off the syntax tree, so dead code and opaque constructs are covered. Nested function-likes are not descended into, and the list is empty when the scope has no written return type.crates/steins-infer/src/compile_fatal_returns.rs): judges each listed return against the scope's written return type. It needs no env, no folder and no dead-region filter. The full rule table is in the module's doc comment.return.compile-fatalis Proof/Default. The message quotes PHP's own sentence.Rule table (every row run on PHP 8.5.11)
: void(function, method, closure or arrow fn)return <expr>;,return null;included: neverreturnfn(): never => 5null,false,true,static,self,mixedand unions)return;: intreturn null;type.return-mismatchreturn 5;?void,int|voidTests
compile_fatal_returns.rshas 30 tests, at least one per row.union_and_return::return_without_value_is_silentused a barereturn;under: int. That is now this id's finding, so the test now asserts onlyreturn.compile-fatal.-D warnings, and so doesxtask changelog.Measurement (ten public packages)
return.compile-fatalhits (vendor included).effect-diff: 0 events.Not measured
Review outcome
Adversarial review: one blocker, now fixed.
returninside a property hook, in a class nested in a typed scope, was charged to the enclosing scope. Fixed in 917f50d5. The function-like boundary is now one helper (opens_function_like: function, method, closure, arrow fn, property hook), shared byscan_returnsandnode_is_generator. Regression tests cover hooks in named and anonymous classes inside void and typed scopes, and ayieldin a hook.php -l): no witness fires where PHP compiles. The only PHP fatals Steins stays silent on are the declared declines:?voidandint|void;04-findings.md, and the constructor/destructor row of the module table (__construct(): void { return 5; }fires, as PHP does).