|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-02-03 23:55 UTC] adam at trachtenberg dot com
[2004-02-04 02:28 UTC] helly@php.net
[2004-02-04 08:11 UTC] kennyt@php.net
[2004-02-04 14:56 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 04:00:02 2025 UTC |
Description: ------------ We should be able to use normal array iteration techniques when going through such pseudoarray structures in simplexml elements, right? Reproduce code: --------------- $xml = simplexml_load_string( '<a> <b></b> <b></b> <b></b> </a>'); while(list($foo, $bar) = each($xml->b)) { echo '"' , $foo , '" - "', $bar , '"' , chr(10); } --OR-- for($i = 0; $i < count($xml->b); ++$i) { echo '"' , $i , '" - "', $xml->b[$i] , '"' , chr(10); } Expected result: ---------------- [3 lines of output] --OR-- "0" - "" "1" - "" "2" - "" Actual result: -------------- [no output] --OR-- "0" - ""