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

Encapsed strings should return non-falsy-string if non-falsy like concat #10943

Open
kkmuffme opened this issue May 3, 2024 · 1 comment · May be fixed by #10948
Open

Encapsed strings should return non-falsy-string if non-falsy like concat #10943

kkmuffme opened this issue May 3, 2024 · 1 comment · May be fixed by #10948

Comments

@kkmuffme
Copy link
Contributor

kkmuffme commented May 3, 2024

https://psalm.dev/r/182c160a4e

Copy link

I found these snippets:

https://psalm.dev/r/182c160a4e
<?php

/**
 * @var string $a
 */

$b = "hello {$a} world";
/** @psalm-trace $b */;

$c = "hello" .  $a . "world";
/** @psalm-trace $c */;
Psalm output (using commit 08afc45):

INFO: Trace - 8:23 - $b: non-empty-string

INFO: Trace - 11:23 - $c: non-falsy-string

INFO: UnusedVariable - 7:1 - $b is never referenced or the value is not used

INFO: UnusedVariable - 10:1 - $c is never referenced or the value is not used

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

Successfully merging a pull request may close this issue.

1 participant