From: joaomfrebelo at gmail dot com
Operating system: Windows 10
PHP version: Irrelevant
Package: XML Reader
Bug Type: Bug
Bug description:next function does not go strict to next sibling node
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
--
Edit bug report at https://bugs.php.net/bug.php?id=80755&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80755&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80755&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80755&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80755&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80755&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80755&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80755&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80755&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80755&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80755&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80755&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80755&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80755&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80755&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80755&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80755&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80755&r=mysqlcfg