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
commit14ed1443182ee47abd9bfa85b28c8a176de36da5 (patch)
tree9054bd1b05b5d578439ae12733e5cd2d9f75eb0f /ext/simplexml/simplexml.c
parentbaf834a00a6facf967941e9a8515a37b2ba9f5ce (diff)
downloadphp-git-14ed1443182ee47abd9bfa85b28c8a176de36da5.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 8e3dc7855d..49498aa70f 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -1264,9 +1264,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) {
@@ -1287,6 +1286,8 @@ SXE_METHOD(xpath)
add_next_index_zval(return_value, value);
}
}
+ } else {
+ RETVAL_FALSE;
}
xmlXPathFreeObject(retval);