|
Posted by "Ford, Mike" on 08/23/05 12:30
-----Original Message-----
From: Larry Brown
To: php
Sent: 23/08/05 02:28
Subject: [PHP] foreach loop changed after 4.3 -> 4.4 upgrade
I had a foreach loop working on an array as such:
$multiarray = array(array('person','person'),array('another','another'))
the array was put through
foreach($multiarray as $subArray){
do something with array
}
on each loop I would see $subArray= array([0] = 'person',[1] = 'person')
and then $subArray= array([0] = 'another',[1] = 'another')
In other cases person might have some other value in the [1] position.
(it is being used in a function to create a select statement).
After the upgrade from 4.3 to 4.4 though each iteration gives...
array([0] = array([0] = 'person', [1] = 'person'),[1] = 0) and
array([0] = array([0] = 'another', [1] = 'another'),[1] = 1)
----------------------------
You have an out-of-date code optimizer insatalled -- install the latest
version of whichever one you are using. This is a known incompatibility --
a quick search in the bugs database would have found multiple entries about
it (see, for instance, http://bugs.php.net/bug.php?id=30914,
http://bugs.php.net/bug.php?id=31194, and at least a couple of dozen
others).
Cheers!
Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
[Back to original message]
|