3v4l.org

run code in 300+ PHP versions simultaneously
<?php $jsonString = '[{"value":"jquery"},{"value":"bootstrap"}]'; $array = json_decode($jsonString); $array2 = array_column($array, "value"); $csv = implode(", ", $array2); echo "Comma Separated String: ", $csv, "\n"; $array3 = explode(", ", $csv); $array4 = array_map(function ($val){ $obj = (object)[]; $obj->value=$val; return $obj; }, $array3); $jsonString2 = json_encode($array4); echo "Json String: ", $jsonString2;
Output for git.master, git.master_jit, rfc.property-hooks
Comma Separated String: jquery, bootstrap Json String: [{"value":"jquery"},{"value":"bootstrap"}]

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