php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #37249 Documentation on DOMDocument::load() incorrect
Submitted: 2006-04-30 08:26 UTC Modified: 2006-05-16 03:11 UTC
From: michiel at leegwtr dot demon dot nl Assigned: ramsey (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Any
Private report: No CVE-ID: None
 [2006-04-30 08:26 UTC] michiel at leegwtr dot demon dot nl
Description:
------------
The code listing in the webpage of php.net in the section DOMDocument::load() shows

$doc=DOMDocument::load('blabla');
.....

which is inconsistent with the method description which states that a bool is returned, not an Object. It should state:

$doc = new DOMDocument();
$doc->load('blabla');


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-30 10:38 UTC] bjori@php.net
"This method may also be called statically to load and create a DOMDocument object. The static invocation may be used when no DOMDocument properties need to be set prior to loading."
 [2006-05-01 07:28 UTC] michiel at leegwtr dot demon dot nl
Still the documentation should also list that static usage. The current display of return type bool is inconsistent.
 [2006-05-16 03:11 UTC] ramsey@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.

Changed return type to "mixed" and added examples for calling load() and loadXML() statically.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Aug 14 02:00:03 2025 UTC