-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
phpstan/phpstan-src
#359Labels
Milestone
Description
Bug report
When trying to get properties on an object that extends SimpleXMLElement you get an error stating that it's properties are private. This is a bit odd as the properties on SimpleXMLElement aren't private.
| 17 | Access to private property $message of parent class SimpleXMLElement. |
Code snippet that reproduces the problem
https://phpstan.org/r/9152ee63-93e2-47ae-91f3-c624331838fe
<?php declare(strict_types = 1);
class HelloWorld extends SimpleXMLElement
{
public function getSelf(): self
{
return new self('');
}
public function getSimpleXMLElement(): SimpleXMLElement
{
return new self('');
}
public function fail(): void
{
echo $this->getSelf()->message;
}
public function success(): void
{
echo $this->getSimpleXMLElement()->message;
}
}
Expected output
[OK] No errors
Reactions are currently unavailable