3v4l.org

run code in 300+ PHP versions simultaneously
<?php $months = range(1, 12); $months = array_map(function ($element) { return str_pad($element, 2, 0, STR_PAD_LEFT); }, $months); var_dump($months); $months = array_combine($months, $months); var_dump($months);
Output for git.master, git.master_jit, rfc.property-hooks
array(12) { [0]=> string(2) "01" [1]=> string(2) "02" [2]=> string(2) "03" [3]=> string(2) "04" [4]=> string(2) "05" [5]=> string(2) "06" [6]=> string(2) "07" [7]=> string(2) "08" [8]=> string(2) "09" [9]=> string(2) "10" [10]=> string(2) "11" [11]=> string(2) "12" } array(12) { ["01"]=> string(2) "01" ["02"]=> string(2) "02" ["03"]=> string(2) "03" ["04"]=> string(2) "04" ["05"]=> string(2) "05" ["06"]=> string(2) "06" ["07"]=> string(2) "07" ["08"]=> string(2) "08" ["09"]=> string(2) "09" [10]=> string(2) "10" [11]=> string(2) "11" [12]=> string(2) "12" }

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:
49.01 ms | 402 KiB | 8 Q