Re: nested functions
| From: | Gyozo Papp | Date: | Tue, 15 May 2001 21:50:58 +0000 |
| Subject: | Re: nested functions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-52940@lists.php.net to get a copy of this message | ||
why don't you pass $x as an argument?
----- Original Message -----
From: "Johannes Schmiderer" <johannes.schmiderer@aon.at>
To: <php-general@lists.php.net>
Sent: 2001. május 15. 23:41
Subject: [PHP] nested functions
> Is there no way to access the $x within the inner function:
>
> function outer()
> {
> $x = 50;
> function inner()
> {
> echo $x;
> }
>
> inner();
> }
>
> Global in the inner function does not work. I do not want to have $x global
> for all.
>
> Hannes Schmiderer
>
>
>
>
> --
> 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
>