note 82853 added to control-structures.continue
| From: | snuffleathotmaildotcom at osu1 dot php dot net | Date: | Tue, 29 Apr 2008 14:42:33 +0000 |
| Subject: | note 82853 added to control-structures.continue | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-138898@lists.php.net to get a copy of this message | ||
bennet at mc dot edu:
I think you missed the exclamation mark at the start of the if expression, which inverts the logical
output of the expression.
<?php
if ( ! ($key % 2) ) {
continue;
}
?>
...Means if the key is NOT even, ie if it is odd, so the first example is actually correct, whereas
your interpretation of it isn't.
----
Server IP: 92.48.74.199
Probable Submitter: 212.84.112.107
----
Manual Page -- http://www.php.net/manual/en/control-structures.continue.php
Edit -- https://master.php.net/note/edit/82853
Del: integrated -- https://master.php.net/note/delete/82853/integrated
Del: useless -- https://master.php.net/note/delete/82853/useless
Del: bad code -- https://master.php.net/note/delete/82853/bad+code
Del: spam -- https://master.php.net/note/delete/82853/spam
Del: non-english -- https://master.php.net/note/delete/82853/non-english
Del: in docs -- https://master.php.net/note/delete/82853/in+docs
Del: other reasons-- https://master.php.net/note/delete/82853
Reject -- https://master.php.net/note/reject/82853
Search -- https://master.php.net/manage/user-notes.php