Skip to content
Free since 2014. Built for the engineers who keep things running.

cat /articles/how-phpstan-got-up-to-59-faster-with-a-native-extension.md

PHP

How PHPStan Got Up to 59% Faster With a Native Extension

The author of PHPStan Turbo, a native PHP extension that makes PHPStan up to 59% faster, walks through how the speedup was built and which tricks mattered more than rewriting in C++.

PHPStan05 Dec 2026 · 2 min read · summary

article --summary

The summary

This is a write-up of a talk about PHPStan Turbo, a native extension that speeds up PHPStan by up to 59%. The author covers how the project got from roughly 60 seconds down to 20 seconds in pure PHP, and then how Turbo adds to that once it is installed through Composer. Readers who only want to confirm their project is getting the speedup can jump to the slide that explains how to check that Turbo is running. The talk also explains why native code is not automatically faster, since every crossing between PHP and C++ has a cost. The author describes shadowed classes, where PHP remains the source of truth and the C++ is an equivalent rewrite, and lists side benefits such as forking processes, restarting with OPcache enabled, and skipping type checks already verified. The write-up closes with the scale of the engine shadowing effort, the binary size work, and a notable speedup for Rector. Slides, an English translation, and the original Czech version are linked from the article, with keyboard and fullscreen controls available.

Editorial note: This is a summary of an article first published by PHPStan. The full piece is on their site.

Reading now

Topic
PHP
Source
PHPStan
Published
05 Dec 2026
Format
Curated summary

Have a take on this?

Write it up and submit it. It goes on the list once an editor approves it.

Submit an article

articles --latest

Latest articles

New from the blogs we follow and the community.

All articles

newsletter --weekly

LaraChat Weekly, minus the noise.

The best reads, new jobs and upcoming events, in one email a week.