note 81182 deleted from control-structures.for by betz
| From: | betz@php.net | Date: | Mon, 18 Feb 2008 10:09:07 +0000 |
| Subject: | note 81182 deleted from control-structures.for by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-136244@lists.php.net to get a copy of this message | ||
Note Submitter: chris
----
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