goto is an unstructured control flow statement. It makes code less readable and maintainable. Structured control flow statements such as if, for, while, continue or break should be used instead.

Noncompliant Code Example

$i = 0;
loop:
  echo("i = $i");
  $i++;
  if ($i < 10){
    goto loop;
  }

Compliant Solution

for ($i = 0; $i < 10; $i++){
  echo("i = $i");
}