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

Lower case propery is lost after trim() #8439

Closed
SCIF opened this issue Aug 29, 2022 · 3 comments · Fixed by #8444
Closed

Lower case propery is lost after trim() #8439

SCIF opened this issue Aug 29, 2022 · 3 comments · Fixed by #8444
Labels
easy problems Issues that can be fixed without background knowledge of Psalm Help wanted internal stubs/callmap

Comments

@SCIF
Copy link
Contributor

SCIF commented Aug 29, 2022

https://psalm.dev/r/fb1b896984

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/fb1b896984
<?php

$a = random_bytes(2);
$b = trim(strtolower($a));
/** @psalm-trace $b */;
Psalm output (using commit afe85fa):

INFO: Trace - 5:23 - $b: string

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

@orklah
Copy link
Collaborator

orklah commented Aug 29, 2022

yep, this should be easy to add through conditional returns in the CoreGenericFunctions file. ltrim and rtrim are also affected

@SCIF
Copy link
Contributor Author

SCIF commented Aug 31, 2022

@orklah , yep, done :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy problems Issues that can be fixed without background knowledge of Psalm Help wanted internal stubs/callmap
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants