From:             [EMAIL PROTECTED]
Operating system: Win2K
PHP version:      4.2.1
PHP Bug Type:     Arrays related
Bug description:  Ragged array returns undefined results

When using an array that has ragged indices, the value in the array is
undefined. Well, actually it can be defined, but it is unexpected. No
errors or warnings are reported. Sample Code:

<?
$ragged = array();
for ( $count = 0; $count < 10; $count++ )
{
        $ragged[$count]        = 'single '.$count;
        $ragged[$count]['idx'] = 'ragged '.$count;
}
?>
<html><head></head><body>
<table border="1">
<tr>
        <td>Expected</td><td>Actual</td>
        <td>Expected IDX</td><td>Actual IDX</td>
</tr>
<?
for ( $count = 0; $count < 10; $count++ )
{
?>
<tr>
        <td> <?= 'single '.$count ?> </td><td> <?= $ragged[$count] ?> </td>
        <td> <?= 'ragged '.$count ?> </td><td> <?= $ragged[$count]['idx'] ?>
</td>
</tr>
<? } ?>
</table></body></html>

-- 
Edit bug report at http://bugs.php.net/?id=19943&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=19943&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=19943&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=19943&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=19943&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=19943&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=19943&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=19943&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=19943&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=19943&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=19943&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=19943&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=19943&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=19943&r=isapi

Reply via email to