3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array("Sachin", "Dhoni"); $sub_arr = array(); $final = array(); foreach($arr as $key => $val){ $sub_arr['pollAnswersId'] = $key; $sub_arr['pollAnswer'] = $val; $sub_final[] = $sub_arr; } $final['pollAnswers'] = $sub_final; echo json_encode($final);
Output for git.master, git.master_jit, rfc.property-hooks
{"pollAnswers":[{"pollAnswersId":0,"pollAnswer":"Sachin"},{"pollAnswersId":1,"pollAnswer":"Dhoni"}]}

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