|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2012-01-30 04:13 UTC] aharvey@php.net
  [2012-01-30 04:13 UTC] aharvey@php.net
 
-Status: Open
+Status: Not a bug
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 04:00:01 2025 UTC | 
Description: ------------ Two identical input values with entities create different results depending if they're inserted as element or attribute into the DOM tree. Entity handling differs as seen in the output below. Test script: --------------- define ('VAL','index.php?e=t&c=au'); $dd = new DOMDocument('1.0', 'UTF-8'); $root = $dd->createElement('root'); $href= $dd->createElement('href',VAL); $root->setAttribute('href',VAL); $root->appendChild($href); $dd->appendChild($root); echo $dd->saveXML(); Expected result: ---------------- <?xml version="1.0" encoding="UTF-8"?> <root href="index.php?e=t&c=au"><href>index.php?e=t&c=au</href></root> Actual result: -------------- <?xml version="1.0" encoding="UTF-8"?> <root href="index.php?e=t&amp;c=au"><href>index.php?e=t&c=au</href></root>