PHPStan 2.2.6 ships a new native PHP extension written in C++ that accelerates the static analyser by 10 to 30 percent. It requires PHP 8.3 or newer.

The Composer package already contains prebuilt binaries for the most common platforms: Linux with glibc or musl on x86_64 and arm64, macOS, and Windows on x86_64. PHPStan automatically loads the binary matching the runtime into its worker processes, so users do not need to configure anything.

Users who run a manually downloaded phpstan.phar can install the extension through PIE with `pie install phpstan/turbo`.

The extension activates only when its version matches what the installed PHPStan release expects. On a mismatch, PHPStan prints a note and runs without it, meaning an outdated extension can affect speed but never analysis results.

Only a few hot paths have been rewritten natively so far, leaving room for larger gains if more components are ported. The extension is fully optional: PHPStan keeps working without it. When enabled, it shadows specific classes that are marked with the #[ShadowedByTurboExtension] attribute.