-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Labels
Description
$opts = [];
$url = 'https://example.com/';
$context = stream_context_create( $opts );
$response = @file_get_contents( $url, false, $context );
$response_headers = handle_response_headers( $http_response_header );
... results in a Variable $http_response_header is undefined.
warning.
However, $http_response_header
is a PHP native (reserved) variable which will automatically be set within the current scope when using the above code.
See: https://www.php.net/manual/en/reserved.variables.httpresponseheader.php
The same principle holds true for the $php_errormsg
.
See: https://www.php.net/manual/en/reserved.variables.phperrormsg.php
sirbrillig