-
-
Notifications
You must be signed in to change notification settings - Fork 863
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
Null Coalescing Operator with objects' attributes #3283
Comments
No info about this yet?( I'm not familiar with phpstan src at all, but if u'll point me in right direction, i can try to make PR |
@ondrejmirtes Is it possible to point us in the right direction, I'm happy to make a PR too to fix this bug. |
@ThibaudDauce I guess that It should be fixed somewhere around |
Running into this as well for @craftcms, on the following lines among others: |
I figured out what I want to do here:
Currently to suppress the error you can do 2) and should be fine. |
Fixed: phpstan/phpstan-src@7ddfa17 (my previous comment is about something else which I want to change but it's unrelated to this bugfix) |
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. |
Bug report
https://phpstan.org/r/d7f7272b-92ac-4497-a6b2-07c98e3df70e
Expected output
There is no error in this code, PHP
isset
is working with nested attributesisset($abc->def->ghi)
(https://www.php.net/manual/fr/function.isset.php#86313) and$var ?? $default
is only a shortcut toisset($var) ? $var : $default
.The text was updated successfully, but these errors were encountered: