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

ParameterTypeWhat it takes
$contextInflateContextA context created with inflate_init().
$datastringA chunk of compressed data.
$flush_modeintOne 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

VersionChange
8.0.0context expects an InflateContext instance now; previously, a resource was expected.

See also

inflate_init()

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.