I'm running PHP 5.2.9-2
Produces the following:
You would think the first two would be equivalent, but instead the first and third are. Is this a bug or a feature. If a bug, is it still in the current version? If assuming the array index name is being evaluated last in the first case, and first in the send two cases.
Kevin
PHP:
$year1=$year2=$year3=2009;
while ($year1 <= date('Y')){
$array1[$year1] = $year1 . "-" . ++$year1;
$array2[$year2+0] = $year2 . "-" . ++$year2;
$array3[$year3+1] = $year3 . "-" . ++$year3;
}
print_r($array1);
print_r($array2);
print_r($array3);
Produces the following:
PHP:
Array
(
[2010] => 2009-2010
[2011] => 2010-2011
[2012] => 2011-2012
[2013] => 2012-2013
)
Array
(
[2009] => 2009-2010
[2010] => 2010-2011
[2011] => 2011-2012
[2012] => 2012-2013
)
Array
(
[2010] => 2009-2010
[2011] => 2010-2011
[2012] => 2011-2012
[2013] => 2012-2013
)
You would think the first two would be equivalent, but instead the first and third are. Is this a bug or a feature. If a bug, is it still in the current version? If assuming the array index name is being evaluated last in the first case, and first in the send two cases.
Kevin