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

Uncaught TypeError with nullsafe operator #9284

Closed
sal-lochbaum opened this issue May 8, 2023 · 2 comments
Closed

Uncaught TypeError with nullsafe operator #9284

sal-lochbaum opened this issue May 8, 2023 · 2 comments

Comments

@sal-lochbaum
Copy link

Bug report

PHPStan doesn't detect a possible null value passed to a function that does not expect null when using the nullsafe operator to obtain the value

Code snippet that reproduces the problem

https://phpstan.org/r/c82bad37-9fa0-4954-9235-134774c2014b

Expected output

Parameter #1 $foo of function write expects string, null given.

Did PHPStan help you today? Did it make you happy in any way?

it helps tremendously catching other possible null-pointers and certainly raises awareness for code smell, that's why I came across this missing check, so thank you!

@ondrejmirtes
Copy link
Member

THank you for your kind words!

Fixed: phpstan/phpstan-src@74d1c9a

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants