summaryrefslogtreecommitdiff
path: root/ext/simplexml/simplexml.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2011-06-07 01:40:54 +0000
committerIlia Alshanetsky <iliaa@php.net>2011-06-07 01:40:54 +0000
commitde2291689cefe3136d777ca649fdbc935cb347a0 (patch)
treeab5a8a695d75571221dc23dcadcf7489371a2137 /ext/simplexml/simplexml.c
parentd86b3633cfc220accb4df62c5a937f70517f364b (diff)
downloadphp-git-de2291689cefe3136d777ca649fdbc935cb347a0.tar.gz
Fixed test 008
Diffstat (limited to 'ext/simplexml/simplexml.c')
-rw-r--r--ext/simplexml/simplexml.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 1d74853cd9..2ec0ca4ab8 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -1294,9 +1294,8 @@ SXE_METHOD(xpath)
result = retval->nodesetval;
- array_init(return_value);
-
if (result != NULL) {
+ array_init(return_value);
for (i = 0; i < result->nodeNr; ++i) {
nodeptr = result->nodeTab[i];
if (nodeptr->type == XML_TEXT_NODE || nodeptr->type == XML_ELEMENT_NODE || nodeptr->type == XML_ATTRIBUTE_NODE) {
@@ -1317,6 +1316,8 @@ SXE_METHOD(xpath)
add_next_index_zval(return_value, value);
}
}
+ } else {
+ RETVAL_FALSE;
}
xmlXPathFreeObject(retval);