ID: 18119
Comment by: saltymeat at hotmail dot com
Reported By: mk at lrn dot ru
Status: No Feedback
Bug Type: Scripting Engine problem
Operating System: ALTLinux-2.4.18, glibc 2.2.5
PHP Version: 4.0CVS-2002-07-02
New Comment:
This problem exists under my setup of PHP 5.0.5, its associated
php_domxml.dll module for the same version of PHP, and Windows XP
Professional served under Apache 2.0.54. create_element() as well as
create_element_ns() return NULL, without so much as a notice. In fact,
I have never been able to get it to return anything but NULL.
Another example, even simpler, that reproduces the error:
<?php
$doc = domxml_new_doc("1.0");
$root = $doc->create_element("notifications");
echo "<pre>";
var_dump($root);
echo "</pre>";
?>
The output is "NULL."
Previous Comments:
------------------------------------------------------------------------
[2002-11-02 01:00:03] php-bugs at lists dot php dot net
No feedback was provided for this bug for over 2 weeks, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2002-10-20 21:42:03] emile at huasing dot com
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.
------------------------------------------------------------------------
[2002-10-17 22:01:43] [EMAIL PROTECTED]
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 at lrn dot 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