ID: 26976
User updated by: dylan dot egan at optusnet dot com dot au
Reported By: dylan dot egan at optusnet dot com dot au
Status: Assigned
Bug Type: XML related
Operating System: *
PHP Version: 5CVS-2004-01-20 (dev)
Assigned To: sterling
New Comment:
Well I tried with PHP 5Beta3 and it worked. Something changed in CVS I
guess. Will wait for patches on CVS.
Don't know what it could be.
Previous Comments:
------------------------------------------------------------------------
[2004-01-20 20:10:40] [EMAIL PROTECTED]
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 :)
------------------------------------------------------------------------
[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