On Tue, 9 Jun 2026 at 10:23, Rob Landers <[email protected]> wrote: > 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 >
Handling of this really does not have to be defined at the RFC level. It's a typechecker implementation — and it's ok for them to differ. This is a good post describing how the direct equivalent in Python is treated differently by Python type checkers: https://pyrefly.org/blog/container-inference-comparison/. Best wishes, Matt
