3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array('day1','day2','day3','day4'); $array2 = array('item1','item2','item3','item4'); $jsonArray = array(); foreach (array_combine( $array1, $array2 ) as $name => $value) { $jsonArray[] = array('name' => $name, 'value' => $value); } echo $json = json_encode($jsonArray);
Output for git.master, git.master_jit, rfc.property-hooks
[{"name":"day1","value":"item1"},{"name":"day2","value":"item2"},{"name":"day3","value":"item3"},{"name":"day4","value":"item4"}]

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:
42.44 ms | 1519 KiB | 4 Q