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

Possible assignment to array should erase any offsets #1366

Closed
muglug opened this issue Feb 19, 2019 · 0 comments
Closed

Possible assignment to array should erase any offsets #1366

muglug opened this issue Feb 19, 2019 · 0 comments
Labels

Comments

@muglug
Copy link
Collaborator

muglug commented Feb 19, 2019

function getArray() : array { return []; }

$params = array(
  'a' => 3.0,
  'b' => array(
    'c' => "a",
  )
);

if (rand(0, 1)) {
  $params = getArray();
}

echo $params['b']['c'];

Expected: No issue
Actual: PossiblyInvalidArrayAccess - https://getpsalm.org/r/ac141a8e8d

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