#18119 [Com]: domxml extension: DomDocument->create_element() doesn't work

From: Date: Mon, 21 Oct 2002 02:42:04 +0000
Subject: #18119 [Com]: domxml extension: DomDocument->create_element() doesn't work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-22901@lists.php.net to get a copy of this message
ID: 18119 Comment by: emile@huasing.com Reported By: mk@lrn.ru Status: Feedback Bug Type: Zend Engine 2 problem Operating System: ALTLinux-2.4.18, glibc 2.2.5 PHP Version: 4.0CVS-2002-07-02 New Comment: I got the same problem also. I'm using ZendEngine2 (PHP4.3.0_zend2_alpha3). Following are my two test cases. 1. $elm = new DomElement("element"); It returns an DomElement object with NO property. I traced the source code, found that the internal constructor function domxml_doc_create_element() was not invoked. 2. $elm = $doc->create_element("element"); The method returns NULL. Furthermore, the internal function domxml_doc_create_element() applied on the wrong object $doc instead of $elm ($doc's type changed to XML_ELEMENT_NODE, previously it was XML_DOCUMENT_NODE ). Dump of $doc is like this: domdocument Object ( [name] => #document [url] => [version] => 1.0 [standalone] => -1 [type] => 1 [compression] => -1 [charset] => 1 [0] => 2 [1] => 136550520 [tagname] => element ) Above bugs exist in all Dom* classes and create_* methods. After I compiled php4 with zend1.3.0, above test cases passed, everything became OK. So I believe it is some kind of bug within ZendEnging2. Previous Comments: ------------------------------------------------------------------------ [2002-10-17 22:01:43] iliaa@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-latest.zip ------------------------------------------------------------------------ [2002-07-02 18:11:03] mk@lrn.ru It seems, that ZendEngine2 breaks create_element() behavior. This method returns NULL instead of DomElement object. There is my test code. <?php $doc = domxml_new_doc("1.0"); $root = $doc->create_element("xdocument"); $root = $doc->append_child($root); $descr = $doc->create_element("description"); $descr = $root->append_child($descr); print $doc->dump_mem(); ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18119&edit=1

« previous php.bugs (#22901) next »