For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > March 2006 > #36822 [Opn]: Wrong arguments' order in DomNode->replace_child's manual page









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #36822 [Opn]: Wrong arguments' order in DomNode->replace_child's manual page
colder@php.net

2006-03-22, 6:59 pm

ID: 36822
Updated by: colder@php.net
Reported By: jimmy at powerzone dot dk
Status: Open
Bug Type: Documentation problem
Operating System: Linux
PHP Version: Irrelevant
New Comment:

The source quote was about DOM and not DOMXML, sorry.

The documentation problem might not be verified.



Previous Comments:
------------------------------------------------------------------------

[2006-03-22 18:29:00] colder@php.net

It seems to be verified, according to the source:

****
PHP_FUNCTION(dom_node_replace_child)
{

...

if (zend_parse_method_parameters(ZEND_NUM_A
RGS() TSRMLS_CC,
getThis(), "OOO", &id, dom_node_class_entry, &newnode,
dom_node_class_entry, &oldnode, dom_node_class_entry) == FAILURE) {
return;
}

****

Here is the patch :

http://patches.colder.ch/domnode-replace-hild.patch

Thanks in advance.

------------------------------------------------------------------------

[2006-03-22 15:59:21] jimmy at powerzone dot dk

Description:
------------
Please browse to the following link :
http://dk.php.net/manual/fi/functio...place-child.php

According to the documentation, the function should be called like this
:

DomNode->replace_child(oldNode, newNode)

This is WRONG!. It should be called like this :

DomNode->replace_child(newNode, oldNode)

I spend hours before I looked in the User Contribution Notes and found
the answer. Please correct this bug ASAP as it will save other
programmers a lot of time.

Reproduce code:
---------------
NA

Expected result:
----------------
NA

Actual result:
--------------
NA


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=36822&edit=1
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com