Menu

1 / 5

PHPStan 2.3 on a Real Laravel App: What Got Faster, What Broke

DEV Community: php·Ivan Mykhavko·about 13 hours ago
#lJZkh16B
#devto#dev#phpstan#collection#laravel
Reading 0:00
15s threshold

PHPStan 2.3 landed on October 1 with a big promise: up to 7.5x faster than PHPStan 2.1 from last December. The numbers in the release post come from WordPress and Drupal. Nice projects, but not the kind of code I work on every day.

So I upgraded a production Laravel app the same month and timed it. The cold run got two times faster. The run I make fifty times a day saved about a second. And the new unused-variable detector found nothing, because Rector had already cleaned up.

Here's what I measured, what broke, and why I left bleeding edge off for now.

The Setup

The app is a mid-size Laravel 11 project I work on:

app/ with 1145 PHP files

Larastan, level 5, plus a phpstan-baseline.neon

PHP 8.3 in a Docker container, 4 CPUs, on WSL2, code on the Linux filesystem

PHPStan 2.2.8 + Larastan 3.10 before, PHPStan 2.3.1 + Larastan 3.13 after

Larastan follows PHPStan releases closely, so I bumped both together.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.