Bug #73907 [Opn->Ana]: nextSibling property not included in var_dump of DOMNode

From: Date: Tue, 10 Jan 2017 17:37:20 +0000
Subject: Bug #73907 [Opn->Ana]: nextSibling property not included in var_dump of DOMNode
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206472@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73907&edit=1 ID: 73907 Updated by: cmb@php.net Reported by: arnout dot boks at moxio dot com Summary: nextSibling property not included in var_dump of DOMNode -Status: Open +Status: Analyzed Type: Bug Package: DOM XML related Operating System: Debian 8 PHP Version: 7.0.14 Block user comment: N Private report: N New Comment: I can confirm the issue: <https://3v4l.org/IrP6M>. The problem appears to be in dom_node_next_sibling_read() which returns FAILURE if there is no next sibling[1]. Compare that with dom_node_previous_sibling_read() which sets the retval to NULL and returns SUCCESS[2]. Several related cases had been fixed with commit 63ccee5b[3], but dom_node_next_sibling_read() had apparently overlooked. [1] <https://github.com/php/php-src/blob/PHP-7.0.14/ext/dom/node.c#L551-L553> [2] <https://github.com/php/php-src/blob/PHP-7.0.14/ext/dom/node.c#L523-L526> [3] <http://git.php.net/?p=php-src.git;a=commit;h=63ccee5b> Previous Comments: ------------------------------------------------------------------------ [2017-01-10 14:32:22] arnout dot boks at moxio dot com Description: ------------ When doing a var_dump of a DOMNode (or one of its subclasses), the nextSibling-property does not show up. Other properties (like previousSibling) are shown as expected. Test script: --------------- <?php $xmlString = '<?xml version="1.0" encoding="utf-8" ?> <root> </root>'; $doc = new DOMDocument(); $doc->loadXML($xmlString); $attr = $doc->documentElement; var_dump($attr); Expected result: ---------------- // ... <snip> ... ["nextSibling"]=> NULL // ... <snip> ... Actual result: -------------- // ... <snip> ... // (no nextSibling) // ... <snip> ... ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73907&edit=1

« previous php.bugs (#206472) next »