<?php function foo(&$bar = null){ $bar = 'newval'; } $bar = 'oldval, will be changed'; foo($bar); echo $bar; //newval