Skip to content

False positive: $http_response_header #176

@jrfnl

Description

@jrfnl
$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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions