#20028 [Opn->Csd]: foreach() escape's 0=>0 entry of an array.

From: Date: Tue, 22 Oct 2002 15:41:20 +0000
Subject: #20028 [Opn->Csd]: foreach() escape's 0=>0 entry of an array.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-23043@lists.php.net to get a copy of this message
ID: 20028 Updated by: sniper@php.net Reported By: daarius@hotmail.com -Status: Open +Status: Closed Bug Type: Scripting Engine problem Operating System: Win32 PHP Version: 4.2.2 New Comment: This bug has been fixed in CVS. In case this was a PHP problem, 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/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2002-10-22 10:14:04] daarius@hotmail.com $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 this bug report at http://bugs.php.net/?id=20028&edit=1

« previous php.bugs (#23043) next »