summaryrefslogtreecommitdiff
path: root/ext/simplexml
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2016-03-08 13:16:46 +0100
committerAnatol Belski <ab@php.net>2016-03-08 13:16:46 +0100
commit58c82ff0b0e5236e6ece2c289b07e1a831cb3fe2 (patch)
tree7db664d1aab28b77e4639c7389bd7f02af73c48d /ext/simplexml
parent69d3b01d9cca2ca727b2855be5b58eb8a9f010f2 (diff)
parent7a4c2fa829bc5a5ae731febe2cf7a74167012e37 (diff)
downloadphp-git-58c82ff0b0e5236e6ece2c289b07e1a831cb3fe2.tar.gz
Merge branch 'PHP-7.0'
* PHP-7.0: fix regression introduced in 5683b6fa39
Diffstat (limited to 'ext/simplexml')
-rw-r--r--ext/simplexml/simplexml.c2
-rw-r--r--ext/simplexml/tests/bug66084_1.phpt2
2 files changed, 3 insertions, 1 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 6152ec0f28..8a1ef4915f 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -1183,7 +1183,7 @@ static HashTable *sxe_get_prop_hash(zval *object, int is_debug) /* {{{ */
node = NULL;
} else if (sxe->iter.type != SXE_ITER_CHILD) {
- if ( sxe->iter.type == SXE_ITER_NONE || !node->children || !node->parent || node->children->next || node->children->children || node->parent->children == node->parent->last ) {
+ if ( sxe->iter.type == SXE_ITER_NONE || !node->children || !node->parent || !node->next || node->children->next || node->children->children || node->parent->children == node->parent->last ) {
node = node->children;
} else {
ZVAL_COPY_VALUE(&iter_data, &sxe->iter.data);
diff --git a/ext/simplexml/tests/bug66084_1.phpt b/ext/simplexml/tests/bug66084_1.phpt
index 80e91df7c6..85ab10ee59 100644
--- a/ext/simplexml/tests/bug66084_1.phpt
+++ b/ext/simplexml/tests/bug66084_1.phpt
@@ -5,12 +5,14 @@ Bug #66084 simplexml_load_string() mangles empty node name, json variant
<?php if (!extension_loaded("json")) print "skip json not available"; ?>
--FILE--
<?php
+echo json_encode(simplexml_load_string('<a><b/><c><x/></c></a>')->c), "\n";
echo json_encode(simplexml_load_string('<a><b/><c><x/></c></a>')), "\n";
echo json_encode(simplexml_load_string('<a><b/><d/><c><x/></c></a>')), "\n";
echo json_encode(simplexml_load_string('<a><b/><c><d/><x/></c></a>')), "\n";
echo json_encode(simplexml_load_string('<a><b/><c><d><x/></d></c></a>')), "\n";
?>
--EXPECT--
+{"x":{}}
{"b":{},"c":{"x":{}}}
{"b":{},"d":{},"c":{"x":{}}}
{"b":{},"c":{"d":{},"x":{}}}