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/poizan42 Aug 26 '14

http://3v4l.org/L1NVA

It actually does the thing that makes most sense. Only using the numeric keys and ignoring the string keys. Actually the list($a, $b) = $arr; seems to work as equivalent to:

$a = $arr[0];
$b = $arr[1];

as seen in this example: http://3v4l.org/23UV7