Goto is coming, but with some restrictions.
In PHP 6, you'll be able to create a static label and then use a break statement to jump to it:
-
<?php
-
for ($i = 0; $i < 9; ++$i)
-
{
-
if (true) {
-
break blah;
-
}
-
echo "not shown";
-
blah:
-
echo "iteration $i\n";
-
}
-
?>
As a general rule, just like the traditional break, you can jump *out* of loop constructs, but you cannot jump *into* them. It is unclear for the moment whether this functionality will be available outside of a loop, but given that this is an expansion of the break keyword, I would tend to assume that this functionality would only be available inside of a loop (I wonder about switches, though....).
For more information, see
this page.