Why is this happening

From: Date: Tue, 17 Apr 2001 20:40:32 +0000
Subject: Why is this happening
Groups: php.general 
Request: Send a blank email to php-general+get-49044@lists.php.net to get a copy of this message
I've got the following code: ----------- while( list( $timeStamp, $elementArray ) = each( $this->ErrorMessages )) { $tmpArray = $elementArray; if( $tmpArray[errorNumber] & $typesToDisplay ) { // line to comment out while( list( $elementKey, $elementValue ) = each( $elementArray )) { if(( $elementKey == "contextvars" ) && ( $includeContextVars )) { $retval .= "$elementKey: $elementValue\n"; } elseif( $elementKey != "contextvars" ) { $retval .= "$elementKey: $elementValue\n"; } } } // Line to comment out } ---------- If I comment out the specified lines, the loops work perfectly as they should. It iterates only as many times are there are elements in each of the associative arrays. However, when I uncomment out the specified lines, it creates an infinite loop. Why? Chris

« previous php.general (#49044) next »