(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)
stream_context_set_params — Set parameters for a stream/wrapper/context
Sets parameters on the specified context.
contextThe stream or context to apply the parameters too.
params
An associative array of parameters to be set in the following format:
$params['paramname'] = "paramvalue";.
| Parameter | Purpose |
|---|---|
notification
|
Name of user-defined callback function to be called whenever a stream triggers a notification. Only supported for http:// and ftp:// stream wrappers. |
options
|
Array of options as in context options and parameters. |
Throws a TypeError if
context is not a valid stream or
stream context resource.
Throws a ValueError if the
options entry of params
is not of the form $arr['wrapper']['option'] = $value,
that is, if one of its elements is not an array or has an integer key.
Throws a TypeError if the
options entry of params
is not an array.
Throws a TypeError if the
notification entry of params
is not a valid callback.
| 版本 | 说明 |
|---|---|
| 8.5.0 |
Now throws a TypeError if the
notification entry of params
is not a valid callback.
|
| 8.0.0 |
Now throws a TypeError if
context is not a valid stream or
stream context resource.
Previously, an E_WARNING was raised and false was returned.
|
| 8.0.0 |
Now throws a ValueError if the
options entry of params
is not of the expected form, and a TypeError
if it is not an array.
Previously, an E_WARNING was raised.
|