The name "goto" is misleading, and often associated with BAD THINGS(tm). Because our proposed solution is not a real GOTO construct, we will instead reuse the "break" keyword, and extend it with a static label.
>>2
They've removed the 'break-as-goto' functionality in the latest PHP6 build, so all that shit is invalid. The example they have provided doesn't work now, either. Change the "break" to a "goto" and voila.
<?php
for ($i = 0; $i < 9; $i++)
{
if (true) {
goto blah;
}
echo "not shown";
blah:
echo "iteration $i\n";
}
?>
Name:
Anonymous2007-08-22 17:56 ID:JDjDXS+e
Shitty coding style is shitty
Name:
Anonymous2007-08-22 22:28 ID:O3B1lFfs
10 if goto="considered dangerous" then goto 30
20 end
30 print "Living on the edge!"
40 goto 20
Name:
Anonymous2007-08-23 4:17 ID:cY569Nhb
How about if (!true) {echo "not shown";} ? Stupid fags.
There are just six forms of goto I like, everything else is probably bullshit for BASIC fags:
1. Tail call
2. call-with-current-continuation
3. break
4. continue
5. If your break can't break multiple loops, getting out from several nested loops is a rare but desirable thing to use goto for
6. try..catch (if your language doesn't provide exceptions, and you're in a long list of shit that could fail, you could use goto to avoid nesting ifs and }}}}}}}}}}}})
>>7 5. If your break can't break multiple loops, getting out from several nested loops is a rare but desirable thing to use goto for
if you write such loops then you're a faggot.
try catch is retarded.