Developer tools

PHPStan 2.3.7 refines array-shape and null-coalescing analysis

PHPStan now retains more precise key and value types when it generalizes certain constant arrays inside loops. It also recognizes more cases where the left side of a null-coalescing expression cannot be null.

The project published this release on 19 November 2026 (UTC).

PHPStan now retains more precise key and value types when it generalizes certain constant arrays inside loops. It also recognizes more cases where the left side of a null-coalescing expression cannot be null.

The patch adds analysis of the exceptions that the range function can throw. Teams updating an analysis baseline can first inspect changes around loops, conditional types and range calls before accepting new results.

Discussion

Sign in to participate.