Successfully parsed SimpleXMLElement comparison to 'false' returning 'true'

后端 未结 3 1648
抹茶落季
抹茶落季 2021-01-21 04:11

I got a very awkward and specific issue with a simplexml evaluation.

The code:

$simplexml = simplexml_load_string($xmlstring);
var_dump($simplexml);
var_         


        
3条回答
  •  萌比男神i
    2021-01-21 04:41

    Have a look here: http://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting

    It says that SimpleXML objects created from empty tags evaluate to false. Maybe that's what's going on?

提交回复
热议问题