Skip to content

Commit b1562e4

Browse files
Fix PHP 8.5 $http_response_header deprecation (#841)
Replaces #840 (due to blocked write access on fork) --------- Co-authored-by: Andy Postnikov <[email protected]>
1 parent 3763af1 commit b1562e4

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
- Update test case to current (PHP) standards ([#831](https://github.com/jsonrainbow/json-schema/pull/831))
1111
- Upgrade test suite to use generators ([#834](https://github.com/jsonrainbow/json-schema/pull/834))
1212
- update to latest json schema test suite ([#821](https://github.com/jsonrainbow/json-schema/pull/821))
13+
- ### Fixed
14+
- Fix PHP 8.5 $http_response_header deprecation ([#840](https://github.com/jsonrainbow/json-schema/pull/840))
1315

1416
## [6.4.2] - 2025-06-03
1517
### Fixed

src/JsonSchema/Uri/Retrievers/FileGetContents.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ public function retrieve($uri)
5151
}
5252

5353
$this->messageBody = $response;
54+
if (function_exists('http_get_last_response_headers')) {
55+
// Use http_get_last_response_headers() for BC compatibility with PHP 8.5+
56+
// where $http_response_header is deprecated.
57+
$http_response_header = http_get_last_response_headers();
58+
}
5459
if (!empty($http_response_header)) {
5560
// $http_response_header cannot be tested, because it's defined in the method's local scope
5661
// See http://php.net/manual/en/reserved.variables.httpresponseheader.php for more info.

0 commit comments

Comments
 (0)