ID: 26976 Updated by: [EMAIL PROTECTED] Reported By: dylan dot egan at optusnet dot com dot au -Status: Open +Status: Assigned Bug Type: XML related Operating System: Linux PHP Version: 5CVS-2004-01-20 (dev) -Assigned To: +Assigned To: sterling New Comment:
Here's simple test: ----------------------------------------------------------- --TEST-- Bug #26976 (Can not access array elements using index) --SKIPIF-- <?php if (!extension_loaded("simplexml")) print "skip simplexml extension is not loaded"; ?> --FILE-- <?php $root = simplexml_load_string( '<?xml version="1.0"?> <root> <child>a</child> <child>b</child> <child>c</child> <child>d</child> </root> '); echo $root->child[0], "\n"; echo $root->child[1], "\n"; echo $root->child[2], "\n"; echo $root->child[3], "\n"; ?> --EXPECT-- a b c d ----------------------------------------------------------- I get this output: a b b b (foreach works fine though :) Previous Comments: ------------------------------------------------------------------------ [2004-01-20 07:13:11] dylan dot egan at optusnet dot com dot au Description: ------------ Trying to read through a parsed XML file with simpleXML, but I can't go past the 2nd level of the array. Reproduce code: --------------- www.ircphp.com/157 Expected result: ---------------- Read --OUTPUT-- ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26976&edit=1