From a3b99b188bd8b4de93a109659eb6c12931917483 Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Sat, 18 Nov 2023 11:11:52 +0300 Subject: [PATCH 1/2] [PHP 8.3] New stream_context_set_options function --- .../functions/stream-context-set-options.xml | 133 ++++++++++++++++++ reference/stream/versions.xml | 1 + 2 files changed, 134 insertions(+) create mode 100644 reference/stream/functions/stream-context-set-options.xml diff --git a/reference/stream/functions/stream-context-set-options.xml b/reference/stream/functions/stream-context-set-options.xml new file mode 100644 index 000000000000..e30c6538f80a --- /dev/null +++ b/reference/stream/functions/stream-context-set-options.xml @@ -0,0 +1,133 @@ + + + + stream_context_set_options + Sets options on the specified context + + + + &reftitle.description; + + boolstream_context_set_options + resourcecontext + arrayoptions + + + Sets options on the specified context. + + + + + &reftitle.parameters; + + + + context + + + The stream or context resource to apply the options to. + + + + + options + + + The options to set for context. + + + + options must be an associative + &array; of associative arrays in the format + $arr['wrapper']['option'] = $value. + + + Refer to context options and parameters + for a listing of stream options. + + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; + + + <function>stream_context_set_options</function> example + + [ + 'protocol_version' => 1.1, + 'user_agent' => 'PHPT Agent', + ], +]; + +stream_context_set_options($context, $options); +var_dump(stream_context_get_options($context)); +?> +]]> + + &example.outputs; + + + array(2) { + ["protocol_version"]=> + float(1.1) + ["user_agent"]=> + string(10) "PHPT Agent" + } +} +]]> + + + + + + + &reftitle.seealso; + + + stream_context_set_option + + + + + + + diff --git a/reference/stream/versions.xml b/reference/stream/versions.xml index aa972b35554b..bf32d0b61cc9 100644 --- a/reference/stream/versions.xml +++ b/reference/stream/versions.xml @@ -14,6 +14,7 @@ + From f2afde0b9bd2138e57f59213dd2ed0e454e7053b Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Sat, 18 Nov 2023 11:20:04 +0300 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Gina Peter Banyard --- reference/stream/functions/stream-context-set-options.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reference/stream/functions/stream-context-set-options.xml b/reference/stream/functions/stream-context-set-options.xml index e30c6538f80a..20ab886197a8 100644 --- a/reference/stream/functions/stream-context-set-options.xml +++ b/reference/stream/functions/stream-context-set-options.xml @@ -39,7 +39,7 @@ options must be an associative &array; of associative arrays in the format - $arr['wrapper']['option'] = $value. + $array['wrapper']['option'] = $value. Refer to context options and parameters @@ -110,7 +110,6 @@ array(1) { -