We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Looking at the PHP docs SimpleXMLElement::addChild can return null, however PHPStan is reporting that addChild can never return null
SimpleXMLElement::addChild
null
addChild
https://phpstan.org/r/8b9cd1df-ed7c-48e0-916a-d8e127e50257
I'd expect no issues reported in the code snippet.
Is the fix as simple as updating this line in functionMap?
- 'SimpleXMLElement::addChild' => ['static', 'name'=>'string', 'value='=>'string|null', 'ns='=>'string|null'], + 'SimpleXMLElement::addChild' => ['static|null', 'name'=>'string', 'value='=>'string|null', 'ns='=>'string|null'],
PHPStan helps me every day. And I've also got to speak at a few conferences off the back of your tool!
The text was updated successfully, but these errors were encountered:
@DaveLiddament After the latest push in 1.11.x, PHPStan now reports different result with your code snippet:
@@ @@ -6: Strict comparison using !== between SimpleXMLElement and null will always evaluate to true. +No errors
Sorry, something went wrong.
Fixed: phpstan/phpstan-src#2808
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.
No branches or pull requests
Bug report
Looking at the PHP docs
SimpleXMLElement::addChild
can returnnull
, however PHPStan is reporting thataddChild
can never returnnull
Code snippet that reproduces the problem
https://phpstan.org/r/8b9cd1df-ed7c-48e0-916a-d8e127e50257
Expected output
I'd expect no issues reported in the code snippet.
Is the fix as simple as updating this line in functionMap?
Did PHPStan help you today? Did it make you happy in any way?
PHPStan helps me every day. And I've also got to speak at a few conferences off the back of your tool!
The text was updated successfully, but these errors were encountered: