You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compile-time return fatals have no id, and type.property-mismatch misses class values, static and trait properties, and destructure targets #952
<?phpfunctionk1(): void { return5; } // Fatal error: A void function must not return a value
<?phpfunctionk2(): int { return; } // Fatal error: A function with return type must return a value
<?phpdeclare(strict_types=1);
class A {} class B {}
class P { publicA$a; publicstaticint$n = 0; }
trait T { publicint$t = 0; }
class Q { use T; }
functionl1(): void { $p = newP(); $p->a = newB(); } // TypeError: Cannot assign B to property P::$a of type Afunctionl2(): void { P::$n = "x"; } // TypeError: Cannot assign string to property P::$n of type intfunctionl3(): void { $q = newQ(); $q->t = "x"; } // TypeError: Cannot assign string to property Q::$t of type intfunctionl4(): void { $p = newP(); [$p->a] = [newB()]; } // TypeError, through a destructure
The first two are compile-time fatals: the file never loads, so nothing in it runs. Steins reports nothing on any of the three files.
Two gaps
Compile-time return fatals have no id.return <value>; in a void function (or a constructor) and a bare return; in a function with a non-void return type are rejected when the file compiles. That is a stronger claim than any runtime finding, and a purely syntactic one.
Part landed in #1060 (type/arity S1): l1 ($p->a = new B() into a typed property) now reports. Still open: l2 (static-property writes), l3 (trait properties, #1051 S8) and l4 (destructure targets).
Activity
steins-infer: pin the shapes mago's and mir's suites check that Stein…
steins-syntax: a scope lists each of its return statements with the b…
steins-infer: a value returned from a void function-like, any return …
docs: ADR-0078's 2026-10-11 amendment, the trace-IR spec, the profile…
steins-syntax: a return or yield inside a property hook belongs to th…
steins-infer: the value relation judges null, arrays and closures aga…
steins-infer: tests pin every row of the value relation's openings, a…
docs: ADR-0043's value-relation amendment, a changelog fragment, and …
steins-infer: a property write that can miss its typed slot (another …
steins-syntax: a scope lists each of its return statements with the b…
steins-infer: a value returned from a void function-like, any return …
docs: ADR-0078's 2026-10-11 amendment, the trace-IR spec, the profile…
steins-syntax: a return or yield inside a property hook belongs to th…
10 remaining items
steins-infer: a property write that can miss its typed slot (another …
steins-infer: a typed property write declines on a __set a used trait…
steins-infer: the value relation judges null, arrays and closures aga…
steins-infer: tests pin every row of the value relation's openings, a…
docs: ADR-0043's value-relation amendment, a changelog fragment, and …
steins-infer: a property write that can miss its typed slot (another …
steins-infer: a typed property write declines on a __set a used trait…
steins-infer: the value relation judges null, arrays and closures aga…
steins-infer: tests pin every row of the value relation's openings, a…
docs: ADR-0043's value-relation amendment, a changelog fragment, and …
steins-infer: a property write that can miss its typed slot (another …
steins-infer: a typed property write declines on a __set a used trait…
zonuexe commentedon Oct 11, 2026
Part landed in #1060 (type/arity S1): l1 (
$p->a = new B()into a typed property) now reports. Still open: l2 (static-property writes), l3 (trait properties, #1051 S8) and l4 (destructure targets).steins-infer: a class holds what its traits give it, through one per-…
zonuexe commentedon Oct 14, 2026
l3 (typed property declared in a trait) landed in #1082. Still open: l2 (static-property writes) and l4 (destructure targets).