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.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to