inflate_init()
inflate_init() — Initialize an incremental inflate context.
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
Initialize an incremental inflate context with the specified encoding.
Signature
inflate_init(int $encoding, array|object $options = []): InflateContext|false
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $encoding | int | One of the ZLIB_ENCODING_* constants. |
| $options | array|object | An associative array which may contain the following elements: level The compression level in range -1..9; defaults to -1. memory The compression memory level in range 1..9; defaults to 8. window The zlib window size (logarithmic) in range 8..15; defaults to 15. strategy One of ZLIB_FILTERED, ZLIB_HUFFMAN_ONLY, ZLIB_RLE, ZLIB_FIXED or ZLIB_DEFAULT_STRATEGY (the default). dictionary A string or an array of strings of ... |
Return value
Returns an inflate context resource (zlib.inflate) on success, or false on failure.
Example
The PHP manual ships no example for inflate_init(); the signature and the parameter table above are the contract.
Changelog
| Version | Change |
|---|---|
| 8.0.0 | On success, this function returns an InflateContext instance now; previously, a resource was returned. |
See also
All PHP 8.5 built-in functions
Reference card built from the PHP manual page inflate_init() (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.