|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #68540 Documenattion about checking SimpleXML needs clarification
Submitted: 2014-12-03 10:47 UTC Modified: 2017-01-28 12:50 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: seo at gacek dot vot dot pl Assigned:
Status: Verified Package: SimpleXML related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: seo at gacek dot vot dot pl
New email:
PHP Version: OS:


 [2014-12-03 10:47 UTC] seo at gacek dot vot dot pl
From manual page:

Documentation needs some more information, to clarify when simplexml object is considered true.

More information here:

Tried adding it to documentation
    <literal>SimpleXML</literal> evaluates to &true; only if it has child nodes or properties - only then object is not considered empty.
    To check if <literal>SimpleXML</literal> object has &string; value you have to cast it to &string;


Leader (last revision 2017-11-13 05:15 UTC by Terserah26 at gmail dot com)

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-05-27 22:59 UTC]
-Status: Open +Status: Verified
 [2015-05-27 22:59 UTC]
I agree that the wording of the documentation is unfortunate:

| SimpleXML objects created from empty tags

An empty tag would most likely be something like <>. Speaking of
empty elements would be better, but would not take into account
that an empty element may have attributes (not properties), and in
this case casting the respective SimpleXML to bool would also
yield true.
 [2017-01-28 12:50 UTC]
-Package: Documentation problem +Package: SimpleXML related
 [2017-11-13 05:17 UTC] Terserah26 at gmail dot com
Selamat Datang Wahai Pecundang !!!!
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Sep 17 22:01:28 2019 UTC