|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2011-06-06 10:01 UTC] ealexs at gmail dot com
 Description: ------------ --- From manual page: http://www.php.net/domelement.setattribute#Description --- DOMElement::setAttribute fails if the value is : "0" (or 0 as numeric) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 17:00:02 2025 UTC | 
Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. No it doesn't: bjori@foobar:~$ php -derror_reporting=-1 <?php $doc = new DOMDocument("1.0"); $node = $doc->createElement("para"); $newnode = $doc->appendChild($node); $n = $newnode->setAttribute("align", 0); $x = $newnode->setAttribute("align2", "0"); var_dump($n, $x); print $doc->saveXML(); object(DOMAttr)#3 (0) { } object(DOMAttr)#4 (0) { } <?xml version="1.0"?> <para align="0" align2="0"/> bjori@foobar:~$