Actions
Bug #6247
closedClass File.php: php function 'each' (line 92) is deprecated - replace
Start date:
16.06.2018
Due date:
% Done:
0%
Estimated time:
Discuss:
Prio Planung:
Vote:
Updated by Benjamin Baer almost 6 years ago
What is this? :o
https://secure.php.net/manual/en/control-structures.foreach.php
<?php $arr = array(1, 2, 3, 4); foreach ($arr as &$value) { $value = $value * 2; } // $arr is now array(2, 4, 6, 8) // without an unset($value), $value is still a reference to the last item: $arr[3] foreach ($arr as $key => $value) { // $arr[3] will be updated with each value from $arr... echo "{$key} => {$value} "; print_r($arr); } // ...until ultimately the second-to-last value is copied onto the last value // output: // 0 => 2 Array ( [0] => 2, [1] => 4, [2] => 6, [3] => 2 ) // 1 => 4 Array ( [0] => 2, [1] => 4, [2] => 6, [3] => 4 ) // 2 => 6 Array ( [0] => 2, [1] => 4, [2] => 6, [3] => 6 ) // 3 => 6 Array ( [0] => 2, [1] => 4, [2] => 6, [3] => 6 ) ?>
Back to javascript. :p
Updated by Elias Villiger almost 6 years ago
- Status changed from New to In Progress
Updated by Elias Villiger almost 6 years ago
- Status changed from In Progress to Closed
Updated by Carsten Rose over 5 years ago
- Target version changed from 18.10.3 to 18.9.2
Actions