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

SimpleXMLElement childrent method returns self instead of static #5700

Closed
marcelthole opened this issue Sep 29, 2021 · 4 comments
Closed

SimpleXMLElement childrent method returns self instead of static #5700

marcelthole opened this issue Sep 29, 2021 · 4 comments
Labels

Comments

@marcelthole
Copy link
Contributor

Bug report

With the upgrade from 0.12.98 => 0.12.99 the SimpleXMLElement children returns self instead of static

Code snippet that reproduces the problem

https://phpstan.org/r/8b1dcfe2-b5bb-419e-9cf3-38b13748cc85

Expected output

The return type of SimpleXMLElement->children() should be the static class. In this case MySimpleXML

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

Yes, PHPStan helps me everyday. Static code analysis is one of the best features in the PHP economy in the last years. 🥳

@marcelthole
Copy link
Contributor Author

maybe duplicate with #5673

@phpstan-bot
Copy link
Contributor

@marcelthole After the latest commit in dev-master, PHPStan now reports different result with your code snippet:

@@ @@
-19: Dumped type: SimpleXMLElement
+19: Dumped type: MySimpleXML
Full report
Line Error
19 Dumped type: MySimpleXML

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@4653d15

@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 Nov 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants