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