diff --git a/src/Symfony/Component/HttpClient/NativeHttpClient.php b/src/Symfony/Component/HttpClient/NativeHttpClient.php index 3d4747a254068..0880513d6aeb9 100644 --- a/src/Symfony/Component/HttpClient/NativeHttpClient.php +++ b/src/Symfony/Component/HttpClient/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]); + } } }