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

extract($arr, EXTR_SKIP) should not invalidate previous variables #7361

Closed
gharlan opened this issue Jan 9, 2022 · 2 comments · Fixed by #10544
Closed

extract($arr, EXTR_SKIP) should not invalidate previous variables #7361

gharlan opened this issue Jan 9, 2022 · 2 comments · Fixed by #10544

Comments

@gharlan
Copy link
Contributor

gharlan commented Jan 9, 2022

https://psalm.dev/r/35e85a72e3

When using the EXTR_SKIP flag for extract(), the existing variable types should not be invalidated by the extract call.

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/35e85a72e3
<?php

$a = 1;

extract([], EXTR_SKIP);

/** @psalm-trace $a */
$a;
Psalm output (using commit 206332b):

INFO: Trace - 8:1 - $a: mixed

@orklah
Copy link
Collaborator

orklah commented Jan 9, 2022

It's handled here:

Currently, every variable in the scope except a few exception is turned into mixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants