Labeled statement

Control flow / Jump statements

<?php

$firstMatchValue = -1;
$array1 = [1, 2, 3];
$array2 = [2, 3, 4];

foreach ($array1 as $value1) {
    foreach ($array2 as $value2) {
        if ($value1 == $value2) {
            $firstMatchValue = $value2;
            goto stop;
        }
    }
}
stop:
echo $firstMatchValue;
//firstMatchValue is 2