Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$http_response_header is wrongly marked as undefined #267

Open
flack opened this issue Jan 19, 2024 · 0 comments
Open

$http_response_header is wrongly marked as undefined #267

flack opened this issue Jan 19, 2024 · 0 comments
Labels

Comments

@flack
Copy link

flack commented Jan 19, 2024

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

@flack flack added the bug label Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant