On 10.11.23 12:33, Craig Francis wrote:
On 10 Nov 2023, at 10:54, Alex Wells<autau...@gmail.com>  wrote:
PHPStan does find 
them:https://phpstan.org/r/38fc1545-2567-49b9-9937-f275dcfff6f5

It does not:

https://phpstan.org/r/c533ff42-80e4-4309-9751-1ec79e359946

Psalm does give you a PossiblyInvalidArgument here, PHPStan will likely
detect this soon too, as both static analyzers are covering more and
more ground. Also note that in your example $q could be an array
(leading to a fatal error in the code)from the request data, which is
why checking types thoroughly (not just coercing them with strval) can
be helpful in avoiding unexpected situations and deciding how to handle
such situations, instead of yolo-ing it.

Reply via email to