<?php
$i = 0;
foreach ($a as $b){
//note que a variável $i será impressa apenas uma vez
echo '$i = '.$i++ .PHP_EOL;
foreach ($b as $c){
echo $c.PHP_EOL;
if($c == 3){
break 2;
}
}
}
PD9waHAKCiRhID0gYXJyYXkgKGFycmF5KDEsMiwzLDQsNSksYXJyYXkoJ2EnLCdiJywnYycsJ2QnKSk7CiRpID0gMDsKZm9yZWFjaCAoJGEgYXMgJGIpewoJLy9ub3RlIHF1ZSBhIHZhcmnDoXZlbCAkaSBzZXLDoSBpbXByZXNzYSBhcGVuYXMgdW1hIHZlegoJZWNobyAnJGkgPSAnLiRpKysgLlBIUF9FT0w7Cglmb3JlYWNoICgkYiBhcyAkYyl7CgkJZWNobyAkYy5QSFBfRU9MOwoJCWlmKCRjID09IDMpewoJCQlicmVhayAyOwoJCX0KCX0KfQ==