Variable Scope

From: Date: Thu, 18 Jan 2001 17:37:10 +0000
Subject: Variable Scope
Groups: php.general 
Request: Send a blank email to php-general+get-35400@lists.php.net to get a copy of this message
I'm a bit troubled with the fact that variables declared at the top of your script are not then global to functions within that script. That in order to see that variable within a function you'd have to declare it as global in the function (understanding that the variable could have been set at the top of the script). This seems extremely backwards to me (me being a VB guy). Would someone kindly shine the light down upon me with an explanation of this logic? And why can't I possibly declare the variable as Global at the top of my script? Thats a big "Hmmmm...."

« previous php.general (#35400) next »