3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ages = [18,25,36,20,23,21,31]; $groups = array_count_values(array_map(function ($v) { return (int)($v / 10); }, $ages)); for ($i = 0; $i <= max(array_keys($groups)); $i++) { echo $i*10 . " to " . ($i*10+9) . " years: " . (isset($groups[$i]) ? $groups[$i]: 0) . "\n"; } for ($i = 0; $i <= max(array_keys($groups)); $i++) { if (isset($groups[$i])) echo $i*10 . " to " . ($i*10+9) . " years: " . $groups[$i] . "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
0 to 9 years: 0 10 to 19 years: 1 20 to 29 years: 4 30 to 39 years: 2 10 to 19 years: 1 20 to 29 years: 4 30 to 39 years: 2

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