Skip to content
New issue

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

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

Already on GitHub? # to your account

False positive undefinedVariable #1110

Open
i582 opened this issue Aug 26, 2021 · 0 comments
Open

False positive undefinedVariable #1110

i582 opened this issue Aug 26, 2021 · 0 comments
Labels
bug Something isn't working false-positive

Comments

@i582
Copy link
Contributor

i582 commented Aug 26, 2021

Code Example

function f() {
  if (1) {
    $info = [];
  }

  if (!isset($info)) {
    return null;
  }

  return $info;
}

Actual Behavior

<critical> ERROR   undefinedVariable: Undefined variable $info at /Users/petrmakhnev/noverify/example/error.php:12
  return $info;
         ^^^^^

Expected Behavior

No error.

@i582 i582 added bug Something isn't working false-positive labels Aug 26, 2021
@i582 i582 added this to the Next milestone Aug 26, 2021
@i582 i582 changed the title Erroneous undefinedVariable False positive undefinedVariable Aug 26, 2021
@i582 i582 modified the milestones: Next, Next-v0.6.0 Aug 31, 2021
@i582 i582 removed this from the Next-v0.5.1 milestone Oct 15, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working false-positive
Projects
None yet
Development

No branches or pull requests

1 participant