goto
suggest changeThe goto operator jumps to another label in the same file and the same function. It has been available since PHP 5.3. The jump cannot enter a loop or a switch.
The goto instruction is a goto followed by the desired target label: goto MyLabel;.
The target of the jump is specified by a label followed by a colon: MyLabel:.
This example will print Hello World!:
<?php
goto MyLabel;
echo 'This text will be skipped, because of the jump.';
MyLabel:
echo 'Hello World!';
?>
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents