AlbeyAmakiir
0
Q:

php pass by reference

<?php
function appendToString(&$string)
{
    $string .= 'Cool Im appended';
}

$str = 'I am a start and - ';
appendToString($str);
echo $str;    // outputs 'I am a start and - Cool Im appended'
?>
5
function add(a, b, output) {
  output.out = a + b;
}

var output = {};
add(5, 3, output);
console.log(output); //output: {out: 8}
1

New to Communities?

Join the community