When casting a SimpleXMLElement to bool, it can be true or false (cf: https://3v4l.org/aOHT6)
But, when using a ternary operator on a SimpleXMLElement phpstan reports a violation Ternary operator condition is always true.: https://phpstan.org/r/7e2a4df7-90db-4dd3-85a4-a7f207fcafe8