Bug #54998 [Asn->Fbk]: DOMElement::setAttribute fails if the value is : "0"
| From: | bjori@php.net | Date: | Tue, 07 Jun 2011 08:15:26 +0000 |
| Subject: | Bug #54998 [Asn->Fbk]: DOMElement::setAttribute fails if the value is : "0" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-161224@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=54998&edit=1
ID: 54998
Updated by: bjori@php.net
Reported by: ealexs at gmail dot com
Summary: DOMElement::setAttribute fails if the value is : "0"
-Status: Assigned
+Status: Feedback
Type: Bug
Package: DOM XML related
Operating System: Debian squeeze1
PHP Version: 5.3.6
Assigned To: rrichards
Block user comment: N
Private report: N
New Comment:
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:~$
Previous Comments:
------------------------------------------------------------------------
[2011-06-06 10:01:17] 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)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54998&edit=1