<?php
function bar( &$var ) {
return $var++;
}
$b = 5;
echo bar( $b ) .PHP_EOL; // Mostra 5 - valor do return
echo $b .PHP_EOL; // Mostra 6 - valor do $b
PD9waHAKCglmdW5jdGlvbiBiYXIoICYkdmFyICkgewoJICAgcmV0dXJuICR2YXIrKzsKCX0KCgkkYiA9IDU7CgllY2hvIGJhciggJGIgKSAuUEhQX0VPTDsgLy8gTW9zdHJhIDUgLSB2YWxvciBkbyByZXR1cm4KCWVjaG8gJGIgICAgICAgIC5QSFBfRU9MOyAvLyBNb3N0cmEgNiAtIHZhbG9yIGRvICRiCg==