Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you remember the order of the expressions in a for loop?

It's a pretty simple question, I always have to go check here and then I hit my head and say it's so obvious. But really after a week of not using it I usually end up writing

for ($i = 1;  $i++; $i <= 10;) {
    echo $i;
} 

some Mnemonic might help

like image 895
Moak Avatar asked Nov 27 '25 16:11

Moak


1 Answers

ICE:

  • Initialisation
  • Check
  • Execute
like image 69
Wrikken Avatar answered Nov 29 '25 04:11

Wrikken



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!