Управляющие конструкции
PHP Manual

goto

The goto operator can be used to jump to another section in the program. The target point is specified by a label followed by a colon, and the instruction is given as goto followed by the desired target label.

Пример #1 goto example

<?php
goto a;
echo 
'Foo';
 
a:
echo 
'Bar';
?>

Результат выполнения данного примера:

Bar

Замечание: The goto operator is available as of PHP 5.3.

Внимание

It is not allowed to jump into a loop or switch statement. A fatal error is issued in such cases.

Image courtesy of » xkcd


Управляющие конструкции
PHP Manual