zstd and brotli are two newer compression formats. Most browsers and web servers support them, and they often beat gzip. This RFC from Jordi Boggiano and Kévin Dunglas would bundle the zstd and brotli extensions with PHP, so you no longer need to install them from PECL.
Why it helps
Tools that need to run everywhere can't ask users to install extra extensions. The RFC names Composer and Symfony AssetMapper as examples. With both formats built in:
- Composer could use them for package archives, which makes downloads smaller and installs faster.
- Asset tools could compress files ahead of time. Servers like Caddy, FrankenPHP and NGINX (with modules) can then serve the precompressed file instead of compressing it on every request.
The RFC wants both formats rather than one. zstd often performs better, but Safari doesn't support it, while brotli at its highest setting can produce smaller files than zstd. Browsers pick whichever format they support, so shipping both covers everyone.
The authors say the C libraries behind both formats are stable. The PHP extensions are thin wrappers around them, so they should be cheap to maintain.
What you'd get
Each extension adds plain functions as well as namespaced ones:
zstd_compress($data); zstd_uncompress($data); brotli_compress($data); brotli_uncompress($data);
zstd also has dictionary versions, like zstd_compress_dict(), and brotli has functions for compressing data in chunks, like brotli_compress_init() and brotli_compress_add(). Both come with stream wrappers (compress.zstd:// and compress.brotli://), so you can read and write compressed files like regular ones. Both also add output compression settings in php.ini, off by default, along with new constants for compression levels.
What it means for existing code
Nothing existing changes. The only risk is the new global function names, which would clash if your code already defines a function with one of them.
Where it stands
It has been under discussion since February 2025. It named PHP 8.5 as the target, but it never went to a vote. The RFC says Kévin Dunglas will do the work to merge the extensions into core once it's approved.
We list it as inactive because the page hasn't changed since February 2025 and no vote was ever held. Its PHP 8.5 target has since shipped.