diff options
author | Christian Stocker <chregu@php.net> | 2002-08-14 07:29:46 +0000 |
---|---|---|
committer | Christian Stocker <chregu@php.net> | 2002-08-14 07:29:46 +0000 |
commit | 43bdd6ed73dba6eddc49ddf38218e9e3e59ea503 (patch) | |
tree | 67627bdd6e4cccc74610a4ffba015d604fe448e0 /ext/domxml/php_domxml.c | |
parent | 3df8889c0bd0fdc5c33653a646978168dde1c3ff (diff) | |
download | php-git-43bdd6ed73dba6eddc49ddf38218e9e3e59ea503.tar.gz |
@ - DomNode->child_nodes() returns empty array instead of false, if no
@ - child nodes are found (chregu)
Diffstat (limited to 'ext/domxml/php_domxml.c')
-rw-r--r-- | ext/domxml/php_domxml.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index 3e6e4a0085..fde6fdfd0a 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -2258,19 +2258,18 @@ PHP_FUNCTION(domxml_node_children) last = ((xmlDoc *) nodep)->children; else last = nodep->children; - if (!last) { - RETURN_FALSE; - } if (array_init(return_value) == FAILURE) { RETURN_FALSE; } - - while (last) { - zval *child; - child = php_domobject_new(last, &ret, NULL TSRMLS_CC); - add_next_index_zval(return_value, child); - last = last->next; + + if (last) { + while (last) { + zval *child; + child = php_domobject_new(last, &ret, NULL TSRMLS_CC); + add_next_index_zval(return_value, child); + last = last->next; + } } } /* }}} */ |