#39255 [Opn->Fbk]: foreach only shows last item
| From: | tony2001@php.net | Date: | Wed, 25 Oct 2006 14:49:49 +0000 |
| Subject: | #39255 [Opn->Fbk]: foreach only shows last item | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-103978@lists.php.net to get a copy of this message | ||
ID: 39255
Updated by: tony2001@php.net
Reported By: PK at KoffieHosting dot com
-Status: Open
+Status: Feedback
Bug Type: Scripting Engine problem
Operating System: ISS 6.0
PHP Version: 5.1.6
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2006-10-25 14:47:59] PK at KoffieHosting dot com
Description:
------------
FastCGI (PHP5) on ISS 6.0: the foreach only shows the last item.
Reproduce code:
---------------
foreach ($_POST['Boxes'] as $Key => $Value);
{
echo '['.$Key.'] => '.$Value;
}
Note that this does work 100%:
while (list($What, $Amount) = each($_POST['Boxes']))
{
echo '['.$Key.'] => '.$Value;
}
Expected result:
----------------
[4] => 0
[2] => 0
[3] => 1
[6] => 0
[1] => 0
[5] => 0
Actual result:
--------------
[5] => 0
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39255&edit=1