[ create a new paste ] login | about

Link: http://codepad.org/n1AragXb    [ raw code | output | fork ]

PHP, pasted on Dec 29:
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
    $my_array = range(0,3);

    foreach ($my_array as $my_value) {
        echo $my_value . PHP_EOL;
    }


    foreach ($my_array as &$my_value) {
        $my_value += 42;
    }
  
  print_r($my_array);


Output:
1
2
3
4
5
6
7
8
9
10
11
0
1
2
3
Array
(
    [0] => 42
    [1] => 43
    [2] => 44
    [3] => 45
)


Create a new paste based on this one


Comments: