Re: Variable Scope
| From: | Derick Rethans | Date: | Sat, 30 Aug 2003 14:33:04 +0000 |
| Subject: | Re: Variable Scope | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-4268@lists.php.net to get a copy of this message | ||
On Sat, 30 Aug 2003 LingWitt@insightbb.com wrote:
> Since the inner loop declares $i again, it should mask the outer loop's
> $i as per other languages. Besides being useful, it makes more sense.
No, that's not true. You don't redeclare ANYTHING here... you're just
using the same variable $i, just like you would do in C.
> Otherwise, the declaratory statement in the second loop is completely
> meaningless.
You don't declare anything...
Derick
--
"Interpreting what the GPL actually means is a job best left to those
that read the future by examining animal entrails."
-------------------------------------------------------------------------
Derick Rethans http://derickrethans.nl/
International PHP Magazine http://php-mag.net/
-------------------------------------------------------------------------