Bug #78805 [NEW]: SimpleXMLElement::count result different

From: Date: Tue, 12 Nov 2019 11:04:20 +0000
Subject: Bug #78805 [NEW]: SimpleXMLElement::count result different
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223686@lists.php.net to get a copy of this message
From: yuubiseiharukana at gmail dot com Operating system: Any PHP version: 7.4.0RC5 Package: SimpleXML related Bug Type: Bug Bug description:SimpleXMLElement::count result different Description: ------------ Test script's $xml->bs and $xml2 looks same, but count is different. https://3v4l.org/HdLQU Test script: --------------- $xmlstr = '<a><bs><b>1</b><b>2</b></bs></a>'; $xml = new SimpleXMLElement($xmlstr); echo count($xml->bs); // 1 echo count($xml->bs->b); // 2 $xmlstr2 = '<bs><b>1</b><b>2</b></bs>'; $xml2 = new SimpleXMLElement($xmlstr2); echo count($xml2); // 2 echo count($xml2->b); // 2 Expected result: ---------------- 1212 or 2222 Actual result: -------------- 1222 -- Edit bug report at https://bugs.php.net/bug.php?id=78805&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=78805&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78805&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78805&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78805&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78805&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78805&r=support Expected behavior: https://bugs.php.net/fix.php?id=78805&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78805&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78805&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78805&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=78805&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=78805&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78805&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78805&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78805&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78805&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78805&r=mysqlcfg

« previous php.bugs (#223686) next »