Bug #3654: Code fragment has a bug

From: Date: Mon, 28 Feb 2000 18:30:26 +0000
Subject: Bug #3654: Code fragment has a bug
Groups: php.dev 
Request: Send a blank email to php-dev+get-16098@lists.php.net to get a copy of this message
From: tibbetts@mit.edu Operating system: PHP version: 3.0.15 PHP Bug Type: Documentation problem Bug description: Code fragment has a bug http://www.php.net/manual/control-structures.continue.php3 the code fragment says: while (list($key,$value) = each($arr)) { if ($key % 2) { // skip even members continue; } do_something_odd ($value); } which does *not* skip even member, it skips odd members. It should be changed to: while (list($key,$value) = each($arr)) { if (!($key % 2)) { // skip even members continue; } do_sometihng_odd ($value); }

« previous php.dev (#16098) next »