Bug #31134 [Com]: foreach() semantics broken between 4.3.9 and 4.3.10

From: Date: Tue, 16 Nov 2021 09:57:26 +0000
Subject: Bug #31134 [Com]: foreach() semantics broken between 4.3.9 and 4.3.10
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237783@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=31134&edit=1

 ID:                 31134
 Comment by:         rs9088988 at gmail dot com
 Reported by:        jlabonsk at eportation dot com
 Summary:            foreach() semantics broken between 4.3.9 and 4.3.10
 Status:             Not a bug
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Linux
 PHP Version:        4.3.10
 Block user comment: N
 Private report:     N

 New Comment:

Every customers of Arlo is important for Arlo that's why, Arlo customer service teams work
24*7.  Arlo administration has set up a team of certified professionals and engineers who leave no
stone unturned to help customers in solving the issue. There are three ways to contact Arlo
representative. Frist to customer support phone number, second is contact form , you can fill it and
send us in just a few seconds and third is most effective and fast is live chat support, you can
simply click on chat icon and follow the instruction on screen you see.
To get more info visit : https://quickutilities.net/blog/arlo-customer-support


Previous Comments:
------------------------------------------------------------------------
[2011-04-01 17:43:25] varioseveral at gmail dot com

Hi.  In this moment the server update the sql, i have problems with my db, i can't export,
import, add, etc.  What can i do for solve this problem?  Thanks

------------------------------------------------------------------------
[2011-03-06 14:16:30] phuquangnam1 at gmail dot com

help

------------------------------------------------------------------------
[2004-12-16 21:17:49] jsjohnst@php.net

Same issue as:
http://bugs.php.net/bug.php?id=31108

Upgrade Zend Optimizer and it fixes it.

------------------------------------------------------------------------
[2004-12-16 20:36:35] jsjohnst@php.net

I can also confirm this is an issue.

------------------------------------------------------------------------
[2004-12-16 20:24:57] jlabonsk at eportation dot com

Description:
------------
The foreach($array as $key) construct returns an array for $key, instead of just the key. This
breaks many scripts that count on $key being a scalar (and well, the key).


Reproduce code:
---------------
$test = array(2, 3, 4, 5);

foreach($test as $key){
	print_r($key);
}

Expected result:
----------------
2345

Actual result:
--------------
Array
(
    [0] => 2
    [1] => 0
)
Array
(
    [0] => 3
    [1] => 1
)
Array
(
    [0] => 4
    [1] => 2
)
Array
(
    [0] => 5
    [1] => 3
)



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=31134&edit=1


Thread (25 messages)

« previous php.bugs (#237783) next »