A retrospective on years of contributions to PHPStan's type inference engine, focusing on handling mixed types. Covers improvements to type narrowing from conditionals, type casts, and comparisons; support for immediately-invoked function expressions; new PHPDoc types like non-falsy-string and @param-out; and advanced type inference for regex patterns, printf functions, and database queries through AST analysis. Demonstrates how subtractable types help narrow down unknowns by eliminating what types cannot be.

7m read timeFrom staabm.github.io
Post cover image
Table of contents
After one focus area is before the next

Sort: