stream_context_set_options

FunctionReturn type changed in PHP 8.4

Sets options on the specified context.

PHP 5
PHP 7
PHP 8.0-8.1
PHP 8.2
PHP 8.3
Added
PHP 8.4
Improved
PHP 8.5
PHP 8.6

stream_context_set_options Function synopsis

stream_context_set_options($context, array $options): true

Parameters

$context

The stream or context resource to apply the options to.

$options

Typearray

The options to set for $context.

Return value

Typetrue

Returns true on success, false on failure

Changes to the stream_context_set_options Function

PHP 8.4

  • Return type changed: bool to true
- stream_context_set_options($context, array $options): bool
+ stream_context_set_options($context, array $options): true

PHP 8.3

  • Function added

stream_context_set_options Function Availability

PHP VersionAvailability
PHP 8.6Upcoming Release Yes
PHP 8.5Supported (Latest) Yes
PHP 8.4Supported Yes
PHP 8.3Security-Fixes Only Yes
PHP 8.2Security-Fixes Only No
PHP 8.1Unsupported No
PHP 8.0Unsupported No
PHP 7.4Unsupported No
PHP 7.3Unsupported No
PHP 7.2Unsupported No
PHP 7.1Unsupported No
PHP 7.0Unsupported No
PHP 5.6Unsupported No
PHP 5.5Unsupported No
PHP 5.4Unsupported No
PHP 5.3Unsupported No