|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31134 foreach() semantics broken between 4.3.9 and 4.3.10
Submitted: 2004-12-16 20:24 UTC Modified: 2004-12-16 21:17 UTC
Avg. Score:5.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:4 (100.0%)
Same OS:2 (50.0%)
From: jlabonsk at eportation dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.10 OS: Linux
Private report: No CVE-ID: None
 [2004-12-16 20:24 UTC] jlabonsk at eportation dot com
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){

Expected result:

Actual result:
    [0] => 2
    [1] => 0
    [0] => 3
    [1] => 1
    [0] => 4
    [1] => 2
    [0] => 5
    [1] => 3


patch_6star (last revision 2010-09-03 16:51 UTC by info at 6stargrp dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-16 20:36 UTC]
I can also confirm this is an issue.
 [2004-12-16 21:17 UTC]
Same issue as:

Upgrade Zend Optimizer and it fixes it.
 [2011-03-06 14:16 UTC] phuquangnam1 at gmail dot com
 [2011-04-01 17:43 UTC] 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
 [2021-06-19 06:48 UTC] steachnical123 at gmail dot com
Here is the link you need to visit:  office it the store of office gadgets to make your  working smooth and effective.visit: www.  to downloaded in your PC with the savvy help. office setup is the best programming  which is broadly utilized in globe .   It is a shocking association that causes you release your best contemplations, complete things, and stay related on the go.   for more subtleties visit:  today.  office it the heap of office mechanical assemblies   to make your working smooth and effective.Get it downloaded in your PC with the speedy assistance visit here for more nuances.  Try which is incredibly simple to exhibit,   download and recover.  Use of it is in addition principal and the client can get capacity with the utilization of it enough. Online Support&help elective is in like way open in all application which gives a moment rule.  office it the heap of office devices to make your  working smooth and effective.visit:  setup to downloaded in your PC with the savvy help.
 [2021-06-19 06:48 UTC] steachnical123 at gmail dot com
McAfee Total Protection provides Windows, Mac and mobile virus protection,    ttps://   spam filtering capabilities, the ability to securely encrypt sensitive files and much, much more.   Connect five or ten devices and protect what. McAfee Antivirus Plus includes a  variety of tools that can optimize your PC’s performance, keep it clean of cookies and temporary files and even pause annoying autoplay videos so you can enjoy a smoother experience on your PC.   Software activation code along with download instructions will be delivered in an e-mail. This code only works in.
 [2021-06-19 06:49 UTC] steachnical123 at gmail dot com
Norton Security Premium gives  all what Norton Security does, in addition to it backs up the individual records,   photographs, recordings and different recollections on your PC.Norton Security gives you the best  of Norton for the numerous ways you interface.   With a solitary basic setup, you get complete insurance that is made to verify your preferred gadgets—PCs, Macs®, cell phones and tablets—so you can be sheltered in any case and any place you associate.   Norton security software is used broadly and it  provides tha simplest ways to useand it is the most effective protection for yur pc's and computers.   Install it in your PC's and stay free from viruses.Do visit for more details. All you have to do  is  to  activate  your Amazon Prime Video on   using the activation code you retrieve Payment Products.   Amazon  Rewards Visa Signature Cards; Store Card; Amazon Business Card;   Amazon Business Line of Credit; Shop with Points;
 [2021-06-19 06:49 UTC] steachnical123 at gmail dot com
Webroot safe is one of the best antivirus software which provides security from malware and threats.  offers full security for your personal information and banking details   is the cheapest antivirus software.  Webroot product key is an alpha-numeric code of 20 digits, that can help users to trigger their webroot antivirus program.Get protection after downloading, installing and activating with key code through   if you buy the product online then you will receive the Keycode on your registered email i'd that you have provided during purchase.Click  to open Webroot safe Console. Webroot AntiVirus keeps watch on obscure projects until its cerebrum in the cloud   goes to a judgment.  The small nearby program clears out the assailant and turns around its activities. It's an exceptionally unordinary framework, however testing demonstrates that it carries out the responsibility, and does it well.
 [2021-06-19 06:49 UTC] steachnical123 at gmail dot com
If your computer does not have the CD-ROM drive or you do not have the Setup CD, follow the steps given below. Visit    Click Set Up. Either type in the model name of your printer,  or click the first two letters shown under First Letters.Canon printer that can be downloaded via  page is the best wireless printer that you can connect to your device and print data smoothly. Canon ijsetup CD is not the well-suited technique to use   setup installation for longer. One can also install from anther origin if your device is having issues in the online installation or any other. Roku gives the least complex approach to stream excitement   to your TV.  With a large number of accessible channels visit  here for more subtleties.Roku provides the simplest way to  stream entertainment to your TV.   With thousands of available channels visit here for more details.  Roku is a streaming device that helps you watch thousands of paid & free video content on your TV screen via  .   Download the setup from   and enter roku activation code.
 [2021-06-19 06:49 UTC] steachnical123 at gmail dot com
Hulu Plus on your gadget, either  utilize the on-screen console to enter your Hulu sign in data or go to   and enter the gadget initiation code. Both of these strategies will enable you to utilize Hulu on any Hulu-upheld gadget.  To activate Hulu Plus on your gadget, either   utilize the on-screen console to enter your Hulu sign in data or go to  and enter the gadget initiation code. Both of these strategies will enable you to utilize Hulu on any Hulu-upheld gadget.   Would you like to set up hulu antivirus in   your PC?... at that point click here for more subtleties.

AVG Antivirus can be installed fairly easily and can be installed by visiting   It facilitates the custom scanning method used by the system, along with real-time security.  Avg is a well- known name in the field of virus protection.  The reason for which this name is common among all end users is its free antivirus and malware protection.It not only sounds   free but it provides a lot more with no money. It scans for virus and malware. AVG is a known name among the users for providing the best security features against any malware. It provides online security, web security, offline security, family security and many other features to its users.  For AVG Activate, Download & complete installation online to get rid of harmful viruses.
 [2021-06-19 06:50 UTC] steachnical123 at gmail dot com
Disney, one among the popular channel is now available on your streaming media players.  The channel provides you access to Disney shows like Jessie, Phineas, Maddie, Austin and a few more at . Disney Now is compatible with multiple devices including Android, iOS, Kindle, Roku, and Apple TV.  You can also watch online using a supported web browser like Chrome, Firefox, or Brave.   - Disney Now has got some great popular shows on it which makes it one of the most trending streaming networks nowadays.
 [2021-06-19 06:50 UTC] steachnical123 at gmail dot com
Here’s How to Use  with your Disney+ Account Disney Plus is one of the most popular streaming services in the world right now.  With the entire catalogue of Disney classics available, plus new favorites like Hamilton and exclusives like Muppets Now, it’s not hard to see why.][/url]  offers a collection of world favorite movies, if you   visit the Disney Plus Begin website you will see top movie favorites. Disney has global distribution agreements with apple google Microsoft, Roku, Sony,   Amazon, Samsung, and LG Having distribution agreements with these popular manufacturers of mobile media devices and smart TV's allows users to connect with  in a variety of way.
 [2021-06-19 06:50 UTC] steachnical123 at gmail dot com
Xfinity is a platform which will keep you entertained and  offers HD content at a very exciting price.  Here you can stream any content online.Xfinity. Let's activate your device.   Enter your activation code: Access  on Roku and smart TV's will be available once your Xfinity products have been set up in your home. Go to   to sign in or create an account,   and then enter your activation code (even if you've already started your taxes for tax year 2020, you'll still need to activate the code). Select Continue and then select your state. Steps to be followed: · Open the web browser on your lp or Desktop.   Visit for the official website of AmericanExpress/CreditCard or click on the official website.Shop your local Walmart store online anytime, anywhere. You can even use the   app and start shopping now. Then, choose a convenient pickup or delivery time. We'll do the shopping and experts will pick the best quality items, or your money back.
 [2021-06-19 06:50 UTC] steachnical123 at gmail dot com
TinyTask is a utility software created by Vista Software. It's incredibly helpful, and what's better is that it's completely free!  It allows users quick and easy access to automating playback and recording. Prior to investing in a managed portfolio,   E*TRADE Capital Management will obtain important information about your financial situation and risk tolerances and provide you with a detailed investment proposal,  investment advisory agreement, and wrap fee programs brochure.   is the link between your Computer and the award-winning Epson Printers. It enables your Computer to command and control these robust printing machines. To download Brother printer drivers, you can download it at the official brother printer site that is  visit here.
 [2021-06-19 06:50 UTC] steachnical123 at gmail dot com
HGTV is an American TV station, along with the complete type is Home and Garden Television.  It flows contents mainly associated with appliances, modular kitchen, and garden materials.  Not having enough cash in your  balance can lead to late payments or prevent you from making quick transactions to other accounts. Many people get addicted to  Also, not everyone can watch We TV on a TV screen due to busy several technical reasons, so they prefer to install We TV on various devices after signing up and activating in TV provider. Open Google Play Store in your smart TV. Install the Bravo TV program. Open the Bravo TV program. Copy the activation code. Go to   from web browser and enter the activation code. You are ready to start streaming.  At that point you should experience the Activation cycle with your TV makers’ membership appeared on the screen. When the setup has succeeded, the PC or any gadget would now be able to be streamed on the web.
 [2021-06-19 06:50 UTC] steachnical123 at gmail dot com
Open your smart TV and Launch the TDS app. Note down your Tbs activation code appear on TV screen. Go to  on web browser. Choose the android smart TV and enter the confirmation code. Once you click on the submit button. You can Install and Activate ESPN on Roku With the new  option. This guide will show you a step-by-step guide on how to add ESPN to your Roku channel list and activate it so that you can follow all ESPN broadcasts and sporting events. NBC stands for National Broadcasting Company, and it is one of the best famous business broadcast TV networks in the US.  You Can Activate NBC on your Roku & Amazon Firestick by visiting ESET is a Slovakian multinational organization known worldwide for providing top-class antivirus. ESET software is the best protection against malware, Trojans, and spyware. You need to visit   to get ESET software.
 [2021-07-11 06:10 UTC] vodalop973 at ovooovo dot com
When these gentlemen came to visit our campus, I was startled to see them standing in front of me. It was amusing and mind-blowing, so I started an alterjob on the same day they came. Fortunately, my blog had a positive response from Google, and I began making passive money.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Jul 30 18:01:30 2021 UTC