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

string index access does not assert non-empty-string #9754

Open
kkmuffme opened this issue May 6, 2023 · 1 comment
Open

string index access does not assert non-empty-string #9754

kkmuffme opened this issue May 6, 2023 · 1 comment

Comments

@kkmuffme
Copy link
Contributor

kkmuffme commented May 6, 2023

https://psalm.dev/r/200b14bb67

Trace should be non-empty-string

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/200b14bb67
<?php

/**
 * @var string $foo
 */
if ( $foo[0] === 'a' ) {
 	/** @psalm-trace $foo */;   
}
Psalm output (using commit 0ea2a6a):

INFO: Trace - 7:27 - $foo: string

kkmuffme added a commit to kkmuffme/psalm that referenced this issue May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants