summaryrefslogtreecommitdiff
path: root/ext/dom
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2017-01-10 23:29:16 +0100
committerNikita Popov <nikic@php.net>2017-01-10 23:29:43 +0100
commit908ad3cc80136a0804138d112f601141a02e0c7c (patch)
treed4700e53d5ded1f510e0588f56508519ebc8b173 /ext/dom
parent79c0cef8ca55298970174770e7642619aa33256c (diff)
parent13edec75a32f8de674a9e0d5b295f9b872212343 (diff)
downloadphp-git-908ad3cc80136a0804138d112f601141a02e0c7c.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
Diffstat (limited to 'ext/dom')
-rw-r--r--ext/dom/node.c3
-rw-r--r--ext/dom/tests/bug69846.phpt12
-rw-r--r--ext/dom/tests/bug73907.phpt20
-rw-r--r--ext/dom/tests/domobject_debug_handler.phpt1
4 files changed, 32 insertions, 4 deletions
diff --git a/ext/dom/node.c b/ext/dom/node.c
index 69477d4302..c3a7819251 100644
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@ -549,7 +549,8 @@ int dom_node_next_sibling_read(dom_object *obj, zval *retval)
nextsib = nodep->next;
if (!nextsib) {
- return FAILURE;
+ ZVAL_NULL(retval);
+ return SUCCESS;
}
php_dom_create_object(nextsib, retval, obj);
diff --git a/ext/dom/tests/bug69846.phpt b/ext/dom/tests/bug69846.phpt
index 08e35cdcf6..2e8e05aa2c 100644
--- a/ext/dom/tests/bug69846.phpt
+++ b/ext/dom/tests/bug69846.phpt
@@ -31,7 +31,7 @@ foreach ($dataNodes AS $node) {
===DONE===
--EXPECTF--
int(3)
-object(DOMText)#%d (18) {
+object(DOMText)#%d (19) {
["wholeText"]=>
string(3) "
"
@@ -57,6 +57,8 @@ object(DOMText)#%d (18) {
NULL
["previousSibling"]=>
NULL
+ ["nextSibling"]=>
+ NULL
["attributes"]=>
NULL
["ownerDocument"]=>
@@ -73,7 +75,7 @@ object(DOMText)#%d (18) {
string(3) "
"
}
-object(DOMElement)#%d (17) {
+object(DOMElement)#%d (18) {
["tagName"]=>
string(5) "form1"
["schemaTypeInfo"]=>
@@ -98,6 +100,8 @@ object(DOMElement)#%d (17) {
string(22) "(object value omitted)"
["previousSibling"]=>
NULL
+ ["nextSibling"]=>
+ NULL
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
@@ -117,7 +121,7 @@ object(DOMElement)#%d (17) {
Value C
"
}
-object(DOMText)#%d (18) {
+object(DOMText)#%d (19) {
["wholeText"]=>
string(1) "
"
@@ -143,6 +147,8 @@ object(DOMText)#%d (18) {
NULL
["previousSibling"]=>
NULL
+ ["nextSibling"]=>
+ NULL
["attributes"]=>
NULL
["ownerDocument"]=>
diff --git a/ext/dom/tests/bug73907.phpt b/ext/dom/tests/bug73907.phpt
new file mode 100644
index 0000000000..346d8135bb
--- /dev/null
+++ b/ext/dom/tests/bug73907.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #73907 nextSibling property not included in var_dump of DOMNode
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$xmlString = '<?xml version="1.0" encoding="utf-8" ?>
+<root>
+</root>';
+
+$doc = new DOMDocument();
+$doc->loadXML($xmlString);
+$attr = $doc->documentElement;
+
+var_dump($attr);
+--EXPECTF--
+object(DOMElement)#%d (%d) {%A
+ ["nextSibling"]=>
+ NULL
+%A} \ No newline at end of file
diff --git a/ext/dom/tests/domobject_debug_handler.phpt b/ext/dom/tests/domobject_debug_handler.phpt
index 3c9f133548..57d4a66ebb 100644
--- a/ext/dom/tests/domobject_debug_handler.phpt
+++ b/ext/dom/tests/domobject_debug_handler.phpt
@@ -47,6 +47,7 @@ DOMDocument Object
[firstChild] => (object value omitted)
[lastChild] => (object value omitted)
[previousSibling] =>
+ [nextSibling] =>
[attributes] =>
[ownerDocument] =>
[namespaceURI] =>