3v4l.org

run code in 300+ PHP versions simultaneously
<?php $records = [ "Coding", "Web development - Coding", "Meeting", "Coding", "Coding", "Content", "Coding", "Coding" ]; $quantities = [ 3, 8, 1, 4.85, 1, 0.5, 6.01, 7 ]; $result = []; foreach ($records as $index => $label){ $result[$label] = ($result[$label] ?? 0) + $quantities[$index]; } var_export(array_keys($result)); var_export(array_values($result));
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'Coding', 1 => 'Web development - Coding', 2 => 'Meeting', 3 => 'Content', )array ( 0 => 21.86, 1 => 8, 2 => 1, 3 => 0.5, )

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