3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); $arr = [["url_id" => 2191238, "time_spent" => 41], ["url_id" => 2191606, "time_spent" => 215], ["url_id" => 2191606, "time_spent" => 25] ]; $its_by_url = array(); foreach($arr as $data) { $its_by_url[ $data["url_id"] ] = 0; } foreach($arr as $data) { $its_by_url[ $data["url_id"] ] += $data["time_spent"]; } print_r($its_by_url);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [2191238] => 41 [2191606] => 240 )

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:
14.94 ms | 405 KiB | 5 Q