For PHP versions < 8.4, you can write a polyfill to be prepared for the future:
if ( ! function_exists("http_get_last_response_headers") ) {
function http_get_last_response_headers() {
if ( ! isset($http_response_header) ) {
return null;
}
return $http_response_header;
}
}