From 63d93fd99523b9608929a38172da3365a6c0821c Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 28 Feb 2024 16:18:15 +0100 Subject: [PATCH] [HttpClient] Fix deprecation on PHP 8.3 --- NativeHttpClient.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NativeHttpClient.php b/NativeHttpClient.php index 3d4747a..0880513 100644 --- a/NativeHttpClient.php +++ b/NativeHttpClient.php @@ -406,7 +406,11 @@ private static function createRedirectResolver(array $options, string $host, ?ar $redirectHeaders['no_auth'] = array_filter($redirectHeaders['no_auth'], $filterContentHeaders); $redirectHeaders['with_auth'] = array_filter($redirectHeaders['with_auth'], $filterContentHeaders); - stream_context_set_option($context, ['http' => $options]); + if (\PHP_VERSION_ID >= 80300) { + stream_context_set_options($context, ['http' => $options]); + } else { + stream_context_set_option($context, ['http' => $options]); + } } }