1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<?php /* * */ function foo() { // when a file is included, the code it contains inherits the variable scope of the line on which the include occurs include 'global_vars.php'; echo $color; } // prints green foo(); // undefined echo $color;