|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-05-10 10:17 UTC] aharvey@php.net
-Status: Open
+Status: Wont fix
[2011-05-10 10:17 UTC] aharvey@php.net
[2011-05-10 10:35 UTC] broshizzledizzle at gmail dot com
[2011-05-10 10:52 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 06:00:01 2025 UTC |
Description: ------------ It makes more sense for setAttribute() to return the object it was called on instead of the attribute that was set. If I was interested in the attribute, I'd have use createAttribute() instead. Test script: --------------- $dom = new DOMDocument(); $body = $dom->createElement('body'); $dom->appendChild($body->setAttribute('class', 'wrapper')); echo $dom->saveHTML(); Expected result: ---------------- I would expect that it would properly append $body to the $dom. Actual result: -------------- Warning: DOMNode::appendChild() [domnode.appendchild]: Couldn't append node in _FILE_ on _LINE_.