3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = [ "1_apartment_bldgs"=>["geraldine", "jai_sai"], "2_housings"=>["housing_prototype", "bla"] ]; $output = []; foreach ($input as $key => $arr) { $arr2 = []; foreach ($arr as $p) { $arr2[$p] = ['project' => ucwords(str_replace('_', ' ', $p))]; } $output[$key] = $arr2; } echo json_encode($output, JSON_PRETTY_PRINT);
Output for git.master_jit, git.master, rfc.property-hooks
{ "1_apartment_bldgs": { "geraldine": { "project": "Geraldine" }, "jai_sai": { "project": "Jai Sai" } }, "2_housings": { "housing_prototype": { "project": "Housing Prototype" }, "bla": { "project": "Bla" } } }

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