#22225 [NEW]: Foreach statement allows for unexpected ';' without throwing error.

From: Date: Fri, 14 Feb 2003 19:16:30 +0000
Subject: #22225 [NEW]: Foreach statement allows for unexpected ';' without throwing error.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-33193@lists.php.net to get a copy of this message
From: ldouglas@whiteiron.tv Operating system: Redhat 7.1 PHP version: 4.3.0 PHP Bug Type: Regexps related Bug description: Foreach statement allows for unexpected ';' without throwing error. foreach($someArray AS $index => $key); { ...instructions } Assuming that $someArray has a length greater than 1; The semi-colon at the end of the foreach() statement does not throw a syntax error and it also does not loop through the instructions, rather it runs the instructions once with what would be the 'last' set of $key -- Edit bug report at http://bugs.php.net/?id=22225&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=22225&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=22225&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=22225&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=22225&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=22225&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=22225&r=support Expected behavior: http://bugs.php.net/fix.php?id=22225&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=22225&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=22225&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=22225&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22225&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=22225&r=dst IIS Stability: http://bugs.php.net/fix.php?id=22225&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=22225&r=gnused

« previous php.bugs (#33193) next »