note 104243 added to control-structures.foreach
| From: | cuonghuyto at osu1 dot php dot net | Date: | Fri, 03 Jun 2011 10:14:50 +0000 |
| Subject: | note 104243 added to control-structures.foreach | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-180214@lists.php.net to get a copy of this message | ||
Note that foreach does zero loop on an empty array
<?php
foreach (array() as $value){
echo $value; // Prints nothing here
}
?>
(This is in an effort to make a strict specification of PHP functions/constructs)
----
Server IP: 213.249.64.162
Probable Submitter: 80.113.160.213
----
Manual Page -- http://www.php.net/manual/en/control-structures.foreach.php
Edit -- https://master.php.net/note/edit/104243
Del: integrated -- https://master.php.net/note/delete/104243/integrated
Del: useless -- https://master.php.net/note/delete/104243/useless
Del: bad code -- https://master.php.net/note/delete/104243/bad+code
Del: spam -- https://master.php.net/note/delete/104243/spam
Del: non-english -- https://master.php.net/note/delete/104243/non-english
Del: in docs -- https://master.php.net/note/delete/104243/in+docs
Del: other reasons-- https://master.php.net/note/delete/104243
Reject -- https://master.php.net/note/reject/104243
Search -- https://master.php.net/manage/user-notes.php