PHP :: Bug #34199 :: SimpleXMLElement is Schroedinger's Cat
| Bug #34199 | SimpleXMLElement is Schroedinger's Cat | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2005-08-20 21:13 UTC | Modified: | 2005-09-15 16:34 UTC |
|
||||||||||
| From: | rasmus@php.net | Assigned: | ||||||||||||
| Status: | Closed | Package: | Scripting Engine problem | |||||||||||
| PHP Version: | 5CVS-2005-08-20 (CVS) | OS: | * | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2005-08-20 21:13 UTC] rasmus@php.net
Description: ------------ An empty SimpleXMLElement object is both true and false Reproduce code: --------------- $xml = "<root></root>"; $xml = simplexml_load_string($xml); $kids = $xml->children(); if($kids) echo "True"; if(!$kids) echo "False"; Expected result: ---------------- False Actual result: -------------- TrueFalse
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2005-08-20 22:33 UTC] rrichards@php.net
[2005-08-20 22:53 UTC] rasmus@php.net
[2005-08-23 03:56 UTC] sniper@php.net
[2005-09-12 13:54 UTC] dmitry@php.net