Skip to content

Commit 0440c19

Browse files
authored
Fix #251: Fixed The predefined locally scoped $http_response_header variable is deprecated since PHP 8.5
1 parent f6a1930 commit 0440c19

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Yii Framework 2 HTTP client extension Change Log
55
------------------------
66

77
- Bug #250: Fixed `TypeError: stream_get_contents(): Argument #1 ($stream) must be of type resource, bool given` in case PHP error reporting is turned off (shaperman)
8+
- Bug #251: Fixed `The predefined locally scoped $http_response_header variable is deprecated` since PHP 8.5 (Arkeins)
89

910

1011
2.0.16 February 13, 2025

src/StreamTransport.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ public function send($request)
6565
}
6666
$responseContent = stream_get_contents($stream);
6767
// see https://php.net/manual/en/reserved.variables.httpresponseheader.php
68+
if (function_exists('http_get_last_response_headers')) {
69+
$http_response_header = http_get_last_response_headers();
70+
}
6871
$responseHeaders = (array)$http_response_header;
6972
fclose($stream);
7073
} catch (\Exception $e) {

0 commit comments

Comments
 (0)