Pass a variable by reference

You can pass a variable by reference to a function so the function can modify the variable. The syntax is as follows:

<?php
function foo(&$var)
{
    $var++;
}

$a=5;
foo($a);
// $a is 6 here
?>

<?php

function &decremente(&$valeur) {
    $valeur = $valeur -1;
    return $valeur;
}

$param = 3;
$nouveau = & decremente($param);
$nouveau = $nouveau - 1;
echo $param;