From 4980fd9c847b02bb398c9803eaa9b539bc81a812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20M=C3=AD=C5=A1ek?= Date: Fri, 16 Aug 2024 15:43:33 +0200 Subject: [PATCH] stream_context_create() with params argument --- src/Peachpie.Library/Streams/Streams.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Peachpie.Library/Streams/Streams.cs b/src/Peachpie.Library/Streams/Streams.cs index 94c7bdcfe..e84d3e2ee 100644 --- a/src/Peachpie.Library/Streams/Streams.cs +++ b/src/Peachpie.Library/Streams/Streams.cs @@ -41,7 +41,8 @@ namespace Pchp.Library.Streams /// Create a new stream context. /// The 2-dimensional array in format "options[wrapper][option]". - public static PhpResource stream_context_create(PhpArray options = null) + /// Must be an associative array in the format $arr['parameter'] = $value, or null. Refers to context parameters. + public static PhpResource stream_context_create(PhpArray options = null, PhpArray @params = null) { if (options == null) { @@ -51,7 +52,10 @@ namespace Pchp.Library.Streams // OK, data lead to a valid stream-context. if (CheckContextData(options)) { - return new StreamContext(options); + return new StreamContext(options) + { + Parameters = @params, + }; } // Otherwise..