3v4l.org

run code in 500+ PHP versions simultaneously
<?php $data = [ 2022 => [ 'Jan' => 1, 'Mar' => 2, ] ]; $allMonths = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; foreach($data as $year => $months) { $total = 0; foreach($allMonths as $monthShort) { $monthCount = $months[$monthShort] ?? 0; $total += $monthCount; echo $monthCount, PHP_EOL; } echo 'Total:' . $total; }
Output for git.master, git.master_jit, rfc.property-hooks
1 0 2 0 0 0 0 0 0 0 0 0 Total:3

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:
48.68 ms | 1248 KiB | 4 Q