|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-02-16 11:24 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2021-02-16 11:24 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 20:00:01 2025 UTC |
Description: ------------ When we advance the cursor with next function the cursor position should be the next sibling node, how ever wrongly the cursor goes always first to the “#text” node: Output of the bellow test: PHPUnit 9.5.2 by Sebastian Bergmann and contributors. Runtime: PHP 8.0.1 Configuration: D:\NetBeansProjects\PHP\Saft-PT_4_php_EE\phpunit.xml Node name Should be 'Customer' and is 'Customer' Node name Should be 'Customer' and is '#text' Node name Should be 'Customer' and is 'Customer' Node name Should be 'Customer' and is '#text' Node name Should be 'Customer' and is 'Customer' Node name Should be 'Customer' and is '#text' Node name Should be 'Customer' and is 'Customer' Node name Should be 'Customer' and is '#text' Node name Should be 'Customer' and is 'MasterFiles' Time: 00:00.149, Memory: 6.00 MB Test script: --------------- public function testTest(): void { $document = <<<XML <MasterFiles> <Customer><CustomerID>CA1</CustomerID></Customer> <Customer><CustomerID>RES</CustomerID></Customer> <Customer><CustomerID>PP</CustomerID></Customer> <Customer><CustomerID>CA3</CustomerID></Customer> </MasterFiles> XML; $reader = new \XMLReader(); $reader->XML($document); while ($reader->name !== "Customer"){ $reader->read();} do{ echo \sprintf("Node name Should be 'Customer' and is '%s' \n", $reader->name); }while ($reader->next()); } Expected result: ---------------- Node name Should be 'Customer' and is 'Customer' Node name Should be 'Customer' and is 'Customer' Node name Should be 'Customer' and is 'Customer' Node name Should be 'Customer' and is 'Customer' Actual result: -------------- Output of the above test: PHPUnit 9.5.2 by Sebastian Bergmann and contributors. Runtime: PHP 8.0.1 Configuration: D:\NetBeansProjects\PHP\Saft-PT_4_php_EE\phpunit.xml Node name Should be 'Customer' and is 'Customer' Node name Should be 'Customer' and is '#text' Node name Should be 'Customer' and is 'Customer' Node name Should be 'Customer' and is '#text' Node name Should be 'Customer' and is 'Customer' Node name Should be 'Customer' and is '#text' Node name Should be 'Customer' and is 'Customer' Node name Should be 'Customer' and is '#text' Node name Should be 'Customer' and is 'MasterFiles' Time: 00:00.149, Memory: 6.00 MB