If you need code that works for both PHP 8 and earlier, and don't want lint warnings in PHP >= 8 because the presence of $http_response_header triggers them:
$headers = (function_exists('http_get_last_response_headers'))
? http_get_last_response_headers()
: (${'http_response_header'} ?? null);