From: ed at avi dot ru Operating system: Windows 98 PHP version: 4.3.2RC1 PHP Bug Type: DOM XML related Bug description: Crash when trying to call DomAttribute's set_namespace method
The following code works correctly: <?PHP $doc = domxml_new_doc ('1.0'); $root = $doc->append_child ($doc->create_element ('root')); $root->set_attribute ('attr', 'value'); $attr = $root->get_attribute_node ('attr'); $root->set_attribute ('attr-class', get_class ($attr)); print ($doc->dump_mem ()); ?> The output is the following: <?xml version="1.0" ?> <root attr="value" attr-class="domattribute" /> It proves that $attr contains an object of type DomAttribute. But if we insert the following line: $attr->set_namespace ('urn:test:test'); the PHP crashes. Apache (1.3.26 with PHP as module) showes the following data (the output is translated from Russian): Program APACHE failed when accessing memory page in module PHP_DOMXML.DLL on address 015f:01311685. Registers: EAX=00000031 CS=015f EIP=01311685 EFLGS=00010202 EBX=00844f70 SS=0167 ESP=035ff5d8 EBP=055f3f60 ECX=05495894 DS=0167 ESI=00000031 FS=8caf EDX=035ff575 ES=0167 EDI=055f2110 GS=0000 Bytes on address CS:EIP: 8a 16 8a 01 46 3a d0 75 0c 41 84 c0 75 f2 b8 01 Stack contents: 05495894 012fc05e 00000031 05495894 00844f70 055f3f60 035ffb88 00844f70 012f6198 055f3fa0 055f3f60 05495894 00000000 05495030 00000000 00000017 -- Edit bug report at http://bugs.php.net/?id=22786&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=22786&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=22786&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=22786&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=22786&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=22786&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=22786&r=support Expected behavior: http://bugs.php.net/fix.php?id=22786&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=22786&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=22786&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=22786&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22786&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=22786&r=dst IIS Stability: http://bugs.php.net/fix.php?id=22786&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=22786&r=gnused