特定の条件が満たされない場合、ループの次の繰り返しにスキップしようとしています。問題は、関係なくループが継続していることです。
どこで間違ったのですか?
最初のコメントに応じてコード サンプルを更新しました。
foreach ($this->routes as $route => $path) {
$continue = 0;
...
// Continue if route and segment count do not match.
if (count($route_segments) != $count) {
$continue = 12;
continue;
}
// Continue if no segment match is found.
for($i=0; $i < $count; $i++) {
if ($route_segments[$i] != $segments[$i] && ! preg_match('/^\x24[0-9]+$/', $route_segments[$i])) {
$continue = 34;
continue;
}
}
echo $continue; die(); // Prints out 34