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

Accessing SimpleXML attributes on php 8 #3947

Closed
b1rdex opened this issue Oct 13, 2020 · 2 comments
Closed

Accessing SimpleXML attributes on php 8 #3947

b1rdex opened this issue Oct 13, 2020 · 2 comments

Comments

@b1rdex
Copy link
Contributor

b1rdex commented Oct 13, 2020

https://phpstan.org/r/765ef3ab-b796-4421-ae18-21413a869809

class HelloWorld
{
	public function sayHello(SimpleXMLElement $item): void
	{
		foreach ($item->items->children() as $groupItem) {
			switch ((string)$groupItem->orderType) {
			}
		}
	}
}

It produces Cannot access property $orderType on SimpleXMLIterator\|null on php 8 on phpstan.org.
IDK why but this code reports Access to private property $orderType of parent class SimpleXMLElement for me locally w/ phpVersion: 80000 setting enabled.

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@befb743

@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 May 10, 2021
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