1<?php
2function appendToString(&$string)
3{
4 $string .= 'Cool Im appended';
5}
6
7$str = 'I am a start and - ';
8appendToString($str);
9echo $str; // outputs 'I am a start and - Cool Im appended'
10?>
1function add(a, b, output) {
2 output.out = a + b;
3}
4
5var output = {};
6add(5, 3, output);
7console.log(output); //output: {out: 8}