3v4l.org

run code in 300+ PHP versions simultaneously
<?php $allTeam = [3, 10, 8, 7]; $result = []; foreach ($allTeam as $home) { foreach ($allTeam as $away) { if ($home === $away) { continue; } $result[] = 'Home Team => '.$home.' vs '. $away.' <= Away Team'; } } print_r($result);

preferences:
30.14 ms | 404 KiB | 5 Q