Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4262 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30516 invoked by uid 1010); 30 Aug 2003 14:18:02 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 30469 invoked from network); 30 Aug 2003 14:18:02 -0000 Received: from unknown (HELO sccmmhc02.asp.att.net) (204.127.203.184) by pb1.pair.com with SMTP; 30 Aug 2003 14:18:02 -0000 Received: from insightbb.com (12-223-87-232.client.insightbb.com[12.223.87.232]) by sccmmhc02.asp.att.net (sccmmhc02) with SMTP id <20030830141801mm2004dlpbe>; Sat, 30 Aug 2003 14:18:01 +0000 Date: Sat, 30 Aug 2003 10:18:00 -0400 Mime-Version: 1.0 (Apple Message framework v552) Content-Type: text/plain; charset=US-ASCII; format=flowed To: internals@lists.php.net Content-Transfer-Encoding: 7bit Message-ID: X-Mailer: Apple Mail (2.552) Subject: Variable Scope From: LingWitt@insightbb.com Variable scope is mediocre at best. For instances: $array = array(1, 2, 3, 4, 5); for ($i = 0; $i < 5; $i++) { $num = $array[$i]; echo $num; for ($i = 0; $i < 5; $i++) { echo $num * $i; } } The inner loop $i doesn't mask the outer loop $i. Thus, the whole things gets screwed up.