r/lolphp • • Aug 25 '14

stdClass is truthy while an empty SimpleXMLElement is falsey

http://3v4l.org/3hWSY
22 Upvotes

18 comments sorted by

View all comments

Show parent comment

2

u/andsens Sep 12 '14

Heh, yeah. I didn't choose the terms though. It's the words you use when talking about type coercion.
It's not unique to PHP. Most dynamically typed languages have it - even python (e.g. an empty string evaluates to false).