- print_r: documentation ( source)
<?php
function getArray($temp) {
return $temp;
//return [1, 2, 3];
}
function squareArray(array &$a) {
foreach ($a as &$v) {
$v *= 2;
}
}
$temp = [1, 2, 3];
// Generates a warning in PHP 7.
$tempA = getArray($temp);
print_r(squareArray((getArray($temp))));