#26976 [Csd]: I can't read pass level one of an array
| From: | dylan dot egan at optusnet dot com dot au | Date: | Wed, 21 Jan 2004 20:18:34 +0000 |
| Subject: | #26976 [Csd]: I can't read pass level one of an array | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-53726@lists.php.net to get a copy of this message | ||
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: Closed
Bug Type: XML related
Operating System: *
PHP Version: 5CVS-2004-01-20 (dev)
New Comment:
Anything to help get this through to production level. Great work so
far, can't wait for final.
Previous Comments:
------------------------------------------------------------------------
[2004-01-21 06:28:22] rrichards@php.net
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2004-01-20 20:47:45] dylan dot egan at optusnet dot com dot au
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.
------------------------------------------------------------------------
[2004-01-20 20:10:40] sniper@php.net
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