Post #258362
2026-02-11 14:33 UTC
@loicfaugeron@phpc.social correct.
PHP mostly* does sensible type coercions for scalar types in weak mode that are better than the forceful casts that will convert any random stuff (e.g. array to string if you use `(string)`).
Moreover the scope of strict_types is really small. It doesn't cover binary operations, or callables called by the engine, and a bunch more.
So a static analysis tool will be stricter than strict_types by quite a bit.
Replies (1)
-
@loicfaugeron@phpc.social 2026-02-12 10:20
@Girgias@phpc.social interesting, thanks for the clarification!