stream_bucket_make_writeable()

stream_bucket_make_writeable() — Returns a bucket object from the brigade to operate on.

Built-in function of PHP 8.5. The manual lists it as available in PHP 5, 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

This function is called whenever there is the need to access and operate on the content contains in a brigade. It is typically called from php_user_filter::filter().

Signature

stream_bucket_make_writeable(resource $brigade): ?StreamBucket

Parameters

ParameterTypeWhat it takes
$brigaderesourceThe brigade to return a bucket object from.

Return value

Returns a bucket object or null.

Example

The PHP manual ships no example for stream_bucket_make_writeable(); the signature and the parameter table above are the contract.

Changelog

VersionChange
8.4.0This function returns a StreamBucket instance now; previously, an stdClass was returned.

See also

stream_bucket_append(), stream_bucket_prepend()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page stream_bucket_make_writeable() (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.