Elektrine lite

← Feed

@loicfaugeron@phpc.social

Post #258049

2026-02-11 14:11 UTC

@Girgias@phpc.social do you mean that if people are using static analysis, then they don't need strict_types; and if they aren't using static analysis, they also don't need strict_types?

Replies (1)

  • @Girgias@phpc.social 2026-02-11 14:33

    @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.

    Open ##258362