Thursday, February 28, 2013

for loops

I read this over at TheDailyWTF and promptly had to clean coffee off of my monitor. This has to be the greatest for loop ever written!

$i = 0;
for (;;) {
$i++;
...
if ($i >= 15) break;
}


Now go clean whatever beverage you were drinking off of your monitor, and don't blame me! I warned you!

(and for those non-coders reading, the entire thing can be replaced with for($i=0 ; $i < 15 ; $i++) { ... })

No comments:

Post a Comment