php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #43095 DOMDocument::loadXML raises an undocumented warning when passed an empty string
Submitted: 2007-10-24 16:00 UTC Modified: 2007-10-25 09:02 UTC
From: mike at silverorange dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2007-10-24 16:00 UTC] mike at silverorange dot com
Description:
------------
DOMDocument::loadXML and DOMDocument::load raise undocumented PHP warnings when passed an empty string as the argument.

Reproduce code:
---------------
$document = new DOMDocument();
$document->loadXML('');

Expected result:
----------------
Since this is by design (see Bug #43809), the documentation should be updated to say what happens when you pass an empty string.

Something like:

"If an empty string is passed as the $source, a PHP warning will be generated. This warning is not generated by libxml and cannot be handled using libxml's error handling functions."


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-25 09:00 UTC] rquadling@php.net
load(), loadXML(), loadHTML(), loadHTMLFile() all exhibit this behaviour  - empty string for loadXML() and loadHTML() and empty file for load() and loadHTMLFile().
 [2007-10-25 09:02 UTC] rquadling@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 06:00:01 2026 UTC