On Thursday, May 14th, 2026 at 6:33 PM, Seifeddine Gmati 
<[email protected]> wrote:

> > But at the same time this PHP script is accepted by PHPStan despite 
> > throwing "Uncaught TypeError: foo(): Argument #1 ($bar) must be of type 
> > string, int given" at runtime [...]
> 
> That's a bug worth reporting to PHPStan. Mago catches it correctly
> https://mago.carthage.software/1.27.1/en/playground/#019e28c0-28e7-a525-cb82-710da883858c,
> disagreement between SA tools on specific cases is a real ecosystem
> issue (this RFC's "Why people use generics" mentions this to an
> extent), and tools improve over time. A false positive, or a false
> negative in one tool doesn't mean that "SA-checked code is a different
> language." (You will find a ton of false positives in Mago and Psalm,
> too.)

Notably, PHPStan is already working on solutions to this kind of issue: 
https://phpstan.org/blog/why-array-string-keys-are-not-type-safe

Reply via email to