Re: Variable Scope
| From: | Philip Olson | Date: | Thu, 18 Jan 2001 18:06:56 +0000 |
| Subject: | Re: Variable Scope | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-35405@lists.php.net to get a copy of this message | ||
A nice explanation, via the mind of Lars Torben Wilson, exists here :
http://marc.theaimsgroup.com/?l=php-general&m=97717398101040&w=2
Also, you may want to check out :
http://www.php.net/manual/en/language.constants.php
http://www.php.net/manual/en/function.define.php
Philip
On Thu, 18 Jan 2001, Karl J. Stubsjoen wrote:
> 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...."
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>