php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #60382 Documented return value for SimpleXML too generic
Submitted: 2011-11-25 09:54 UTC Modified: 2011-11-27 03:29 UTC
From: bfanger at gmail dot com Assigned: frozenfire (profile)
Status: Closed Package: Documentation problem
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bfanger at gmail dot com
New email:
PHP Version: OS:

 

 [2011-11-25 09:54 UTC] bfanger at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.simplexml-load-string#refsect1-
function.simplexml-load-string-description
---
The simplexml_load_file() and simplexml_load_string() functions are documented 
to return a "object".
(Which prevents autocompletion in IDE's)

I propose to change the return value to SimpleXMLElement and the documentation 
to:

"Returns an SimpleXMLElement (or the specified descendant) with properties 
containing the data held within the xml document. On errors, it will return 
FALSE."

or the shorter:
"Returns a SimpleXMLElement or FALSE on failure."

That's used at http://www.php.net/manual/en/function.simplexml-import-dom.php


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-27 03:29 UTC] frozenfire@php.net
Automatic comment from SVN on behalf of frozenfire
Revision: http://svn.php.net/viewvc/?view=revision&revision=319987
Log: Changed return type to SimpleXMLElement, for the purpose of simplification. Closes bug #60382.
Also changed returns to use proper 'or false on failure' entity.
 [2011-11-27 03:29 UTC] frozenfire@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: frozenfire
 [2011-11-27 03:29 UTC] frozenfire@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 11:00:02 2026 UTC