3v4l.org

run code in 300+ PHP versions simultaneously
<?php $results = array ( 0 => array ( "punti" => 418, "vittorie" => 9, "podi" => 18, "gv" => 14, "id_pilota" => 1, "team" => "Red Bull Racing", "naz" => "it" ), 1 => array ( "punti" => 353, "vittorie" => 6, "podi" => 16, "gv" => 3, "id_pilota" => 19, "team" => "Scuderia Ferrari", "naz" => "it" ), 2 => array ( "punti" => 335, "vittorie" => 4, "podi" => 15, "gv" => 1, "id_pilota" => 5, "team" => "Mercedes-AMG", "naz" => "it" ), 3 => array ( "punti" => 181, "vittorie" => 1, "podi" => 5, "gv" => 1, "id_pilota" => 2, "team" => "Mercedes-AMG", "naz" => "it" ), 4 => array ( "punti" => 147, "vittorie" => 0, "podi" => 3, "gv" => 0, "id_pilota" => 14, "team" => "Racing Point F1", "naz" => "mx" ), 5 => array ( "punti" => 127, "vittorie" => 0, "podi" => 0, "gv" => 0, "id_pilota" => 13, "team" => "Haas F1", "naz" => "dk" ) ); $teams = array(); foreach ($results as $result) { $team = $result['team']; if (!isset($teams[$team])) { $teams[$team] = array('team' => $team, 'points' => $result['punti']); } else { $teams[$team]['points'] += $result['punti']; } } $teams = array_values($teams); print_r($teams);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [team] => Red Bull Racing [points] => 418 ) [1] => Array ( [team] => Scuderia Ferrari [points] => 353 ) [2] => Array ( [team] => Mercedes-AMG [points] => 516 ) [3] => Array ( [team] => Racing Point F1 [points] => 147 ) [4] => Array ( [team] => Haas F1 [points] => 127 ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
57.82 ms | 1623 KiB | 4 Q