DOMElement->setAttribute() loops forever (node_list_unlink bug?)
| From: | Riku Palomäki | Date: | Mon, 15 May 2006 22:03:22 +0000 |
| Subject: | DOMElement->setAttribute() loops forever (node_list_unlink bug?) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-236226@lists.php.net to get a copy of this message | ||
Hello,
I'm having problems with DOMElement->setAttribute() -method with my php
script. I stripped down the code to this:
----------------------
$doc = new DOMDocument();
$doc->resolveExternals = true;
$doc->loadXml('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><a
b="" />');
$root = $doc->getElementsByTagName('a')->item(0);
$root->setAttribute('b', '>');
$root->setAttribute('b', '');
// This will never be executed
echo "done\n";
----------------------
That another setAttribute() -call never finishes, and the script will
just eventually die because of "PHP Fatal error: Maximum execution
time.." I have tried this with cgi and cli versions of PHP 5.1.4, 5.1.1
and 5.0.5 on different servers (and different ISPs).
When running, php-process takes all CPU. I tried to debug it with gdb
and got this backtrace: http://www.palomaki.fi/dev/tmp/bt.txt - I ran
it, waited for ~5 seconds, and hit ctrl+c to pause the program to get
the backtrace. node_list_unlink seems to be calling itself forever.
Is there something I don't get, or should I just fill the bug report?
--
Riku Palomäki