From: [EMAIL PROTECTED]
Operating system:
PHP version: 5CVS-2004-02-03 (dev)
PHP Bug Type: *XML functions
Bug description: can't iterate thru simplexml_element objects in normal ways
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" - ""
--
Edit bug report at http://bugs.php.net/?id=27139&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27139&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27139&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27139&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27139&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27139&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27139&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27139&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27139&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27139&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27139&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27139&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27139&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27139&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27139&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27139&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27139&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27139&r=float