Skip to content

$http_response_header is wrongly marked as undefined #267

Open
@flack

Description

@flack

Describe the bug
If you take the example code from https://www.php.net/manual/en/reserved.variables.httpresponseheader.php:

<?php
function get_contents() {
  file_get_contents("http://example.com");
  var_dump($http_response_header); // variable is populated in the local scope
}
get_contents();
var_dump($http_response_header); // a call to get_contents() does not populate the variable outside the function scope
?>

PDT renders it like this:

Bildschirmfoto 2024-01-19 um 12 47 34

So the warnings are exactly the wrong way around.

Describe the eclipse environment
Eclipse 2023-12
Eclipse PDT 8.3.0.202312151406

Describe your system

  • OS: macOS
  • Version 13.6

To Reproduce
see above

Expected behavior
It's probably hard to determine statically when exactly the variable is defined, so it might be better to be consistent and either mark all occurences as defined or all occurences as undefined.

Screenshots
see above

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions