#19943 [NEW]: Ragged array returns undefined results

From: Date: Thu, 17 Oct 2002 00:50:57 +0000
Subject: #19943 [NEW]: Ragged array returns undefined results
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-22618@lists.php.net to get a copy of this message
From: su-php@bossi.com 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

« previous php.bugs (#22618) next »