Re: [RFC] [Discussion] Bound-Erased Generic Types

From: Date: Tue, 09 Jun 2026 14:20:40 +0000
Subject: Re: [RFC] [Discussion] Bound-Erased Generic Types
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-131187@lists.php.net to get a copy of this message
To reply to both of you: > The issue you found in Rob's branch is real: half-done inference makes > call-site safety depend on the callee's implementation. That's a > problem with partial inference, not with the call-site syntax. The fix > is the same: require turbofish at every call site, no engine-side > inference. Once the engine stops guessing, call-site safety stops > depending on what the body of the callee does. I don't have enough time today to write out long responses to both your comments. But to this end, scalar inference requires deciding how to handle at the RFC level, not a POC level. new Box(42); new Box(42.0); new Box("42") In non-strict mode, are these all equivalent? What exactly is T's type here? Scalars in PHP ... are weird. I wasn't going to try to define it here. — Rob

« previous php.internals (#131187) next »