Bug #3153: while loop in consequtive calls to a function fails

From: Date: Sun, 09 Jan 2000 02:43:12 +0000
Subject: Bug #3153: while loop in consequtive calls to a function fails
Groups: php.dev 
Request: Send a blank email to php-dev+get-14438@lists.php.net to get a copy of this message
From: bojanland@home.com Operating system: Linux 2.2.6 i586 PHP version: 3.0.13 PHP Bug Type: Misbehaving function Bug description: while loop in consequtive calls to a function fails function test() { global $pageinfo, $themes, $pagetheme, $pagename; echo "preloop"; while (list($akey) = each($pageinfo)) { echo "inloop"; } echo "postloop"; } In the above example, $pageinfo and $themes are arrays of arrays while $pagetheme and $pagename are just strings. In the above case, calling the function for the first time gives us preloop, inloop (many times) and postloop, which is fine. However, calling it the second time right after the first, or a bit later, yields only preloop and postloop.

« previous php.dev (#14438) next »