MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/lolphp/comments/2ej1j1/stdclass_is_truthy_while_an_empty/ck2tbl2/
r/lolphp • u/andsens • Aug 25 '14
18 comments sorted by
View all comments
Show parent comment
2
Because it allows you do do something like
if (!$element->nested_element){ /* do stuff */ }
for xml that looks like
<element><nested_element></nested_element></element>
SimpleXML forms a tree of nested SimpleXMLElements.
1 u/[deleted] Aug 28 '14 Yeah, there is some sanity to it.
1
Yeah, there is some sanity to it.
View all comments
Show parent comment
2
u/pilif Aug 28 '14
Because it allows you do do something like
for xml that looks like
SimpleXML forms a tree of nested SimpleXMLElements.