This is blowing my mind...
I've got a standalone PHP file, and a simple function with a global var.
<?php
$var = 4;
function echoVar()
{
echo $var;
}
echoVar();
?>
When I call echoVar()
nothing is returned... However if I place the $var
inside the function it will return 4.
What's going on here? Shouldn't $var
be global in this case?