1$b=2;
2$a=$b;
3$a=3;
4print $a;
5print $b;
6// output is 32
7
8$b=2;
9$a=&$b; // note the & operator
10$a=3;
11print $a;
12print $b;
13// output is 33
14
1function plus_by_reference( &$param ) {
2 // what ever you do, will affect the actual parameter outside the function
3 $param++;
4}
5
6$a=2;
7plus_by_reference( $a );
8echo $a;
9// output is 3