Project

General

Profile

Actions

Bug #6247

closed

Class File.php: php function 'each' (line 92) is deprecated - replace

Added by Carsten Rose almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Elias Villiger
Target version:
Start date:
16.06.2018
Due date:
% Done:

0%

Estimated time:
Discuss:
Prio Planung:
Vote:
Actions #1

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

Actions #2

Updated by Carsten Rose almost 6 years ago

  • Assignee set to Elias Villiger
Actions #3

Updated by Elias Villiger almost 6 years ago

  • Status changed from New to In Progress
Actions #4

Updated by Elias Villiger almost 6 years ago

  • Status changed from In Progress to Closed
Actions #5

Updated by Carsten Rose over 5 years ago

  • Target version changed from 18.10.3 to 18.9.2
Actions

Also available in: Atom PDF