note 81182 added to control-structures.for
| From: | chris at osu1 dot php dot net | Date: | Sun, 17 Feb 2008 17:16:09 +0000 |
| Subject: | note 81182 added to control-structures.for | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136224@lists.php.net to get a copy of this message | ||
im just getting into php and was looking at these examples and asked one of my friends about example
number 4 and why the $j += $i would be in there. he pointed out to me that it basically wouldnt do
anything at all in there because it would be saving the value to $j which is never shown or printed
in the example, altho i do see how it could be useful wouldnt something along the lines of
for ($i = 0, $j = 1; $i < 10; $i += $j, print $i);
do better to show that you can modify $i using $j and still get the same result of 1-10 being
printed out, and then you dont just have $i going up because of the $i++ which is basically just
like example one with extra random crap that is doing nothing
----
Server IP: 208.69.120.35
Probable Submitter: 65.111.208.82
----
Manual Page -- http://www.php.net/manual/en/control-structures.for.php
Edit -- https://master.php.net/note/edit/81182
Del: integrated -- https://master.php.net/note/delete/81182/integrated
Del: useless -- https://master.php.net/note/delete/81182/useless
Del: bad code -- https://master.php.net/note/delete/81182/bad+code
Del: spam -- https://master.php.net/note/delete/81182/spam
Del: non-english -- https://master.php.net/note/delete/81182/non-english
Del: in docs -- https://master.php.net/note/delete/81182/in+docs
Del: other reasons-- https://master.php.net/note/delete/81182
Reject -- https://master.php.net/note/reject/81182
Search -- https://master.php.net/manage/user-notes.php