$bar = 1; function foo() { global $bar; echo $bar; }