|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-03-24 10:03 UTC] tony2001@php.net
[2006-03-24 10:31 UTC] clemens at gutweiler dot net
[2006-03-30 04:30 UTC] simp@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Jun 18 05:00:01 2026 UTC |
Description: ------------ casting empty simplexml objects to boolean, empty objects get transformed to false. Reproduce code: --------------- var_dump( $foo = simplexml_load_string( "<foo />" ) ); object(SimpleXMLElement)#1 (0) { } var_dump( (bool)simplexml_load_string( "<foo />" ) ); bool(false) var_dump( (bool)simplexml_load_string( "<foo>foo</foo>" ) ); bool(true) Expected result: ---------------- both boolean-casts should be true.