inflate_add()
inflate_add() — Incrementally inflate encoded data.
Built-in function of PHP 8.5. The manual lists it as available in PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
What it does
Incrementally inflates encoded data in the specified context.
Signature
inflate_add(InflateContext $context, string $data, int $flush_mode = ZLIB_SYNC_FLUSH): string|false
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $context | InflateContext | A context created with inflate_init(). |
| $data | string | A chunk of compressed data. |
| $flush_mode | int | One of ZLIB_BLOCK, ZLIB_NO_FLUSH, ZLIB_PARTIAL_FLUSH, ZLIB_SYNC_FLUSH (default), ZLIB_FULL_FLUSH, ZLIB_FINISH. Normally you will want to set ZLIB_NO_FLUSH to maximize compression, and ZLIB_FINISH to terminate with the last chunk of data. See the zlib manual for a detailed description of these constants. |
Return value
Returns a chunk of uncompressed data, or false on failure.
Example
The PHP manual ships no example for inflate_add(); the signature and the parameter table above are the contract.
Changelog
| Version | Change |
|---|---|
| 8.0.0 | context expects an InflateContext instance now; previously, a resource was expected. |
See also
All PHP 8.5 built-in functions
Reference card built from the PHP manual page inflate_add() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.