|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-06-15 12:22 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 21:00:02 2025 UTC |
Description: ------------ The TestFest seems to be working :) Just found a strange behavior in DOMDocument::validate(). If no DTD is given you'll both have a E_NOTICE and a E_WARN saying pretty much the same. Looking at the implementation it seems like PHP tries to define this behavior as a E_NOTICE, while it will fail in libxml as a E_WARN. I would expect this method to raise just one of the error messages, not both. The E_NOTICE is raised in line 1941 in ext/dom/document.c Reproduce code: --------------- <?php $xml = "<?xml version=\"1.0\"?> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend</body> </note>"; $dom = new DOMDocument('1.0'); $dom->loadXML($xml); var_dump($dom->validate()); ?> Expected result: ---------------- Warning: DOMDocument::validate(): no DTD found! in %s on line 11 Actual result: -------------- Notice: DOMDocument::validate(): No DTD given in XML-Document in %s on line 11 Warning: DOMDocument::validate(): no DTD found! in %s on line 11