|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2006-03-28 00:08 UTC] tony2001@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 01:00:01 2025 UTC | 
Description: ------------ Error messages are printed when parsing invalid XML document despite of the fact that they should be (and are) converted to exceptions. Reproduce code: --------------- <?php function err2exc($errno, $errstr, $errfile, $errline) { throw new Exception($errstr); } $xml = '<?xml version="1.0"?> <aaa> <bbb>ddddd < </bbb> </aaa '; set_error_handler('err2exc', E_ALL); error_reporting(E_ALL); try { $doc = DOMDocument::loadXML($xml); } catch (Exception $e) { echo "Exception caught\n"; var_dump($e->getMessage()); } ?> Expected result: ---------------- Exception caught string(73) "DOMDocument::loadXML(): StartTag: invalid element name in Entity, line: 4" Actual result: -------------- Warning: DOMDocument::loadXML(): expected '>' in Entity, line: 7 in /tmp/1.php on line 26 Exception caught string(73) "DOMDocument::loadXML(): StartTag: invalid element name in Entity, line: 4"