#20028 [NEW]: foreach() escape's 0=>0 entry of an array.
| From: | daarius at hotmail dot com | Date: | Tue, 22 Oct 2002 15:14:04 +0000 |
| Subject: | #20028 [NEW]: foreach() escape's 0=>0 entry of an array. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-23037@lists.php.net to get a copy of this message | ||
From: daarius@hotmail.com
Operating system: Win32
PHP version: 4.2.2
PHP Bug Type: Scripting Engine problem
Bug description: foreach() escape's 0=>0 entry of an array.
$a = array(0=>0, 1=>1);
foreach ($a as $key => $val) {
print "key: ".$key.", val: ".$val;
}
above, the 0=>0 entry is simply skipped, and the itteration starts from 1.
(it skips the 0 key OR value either string or integer.)
--
Edit bug report at http://bugs.php.net/?id=20028&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20028&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20028&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20028&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20028&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20028&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20028&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20028&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20028&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20028&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20028&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20028&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20028&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20028&r=isapi