3v4l.org

run code in 300+ PHP versions simultaneously
<?php $index_norm = array("key1" => "foobar", "key2" => "bananaramam", "key3" => "spam"); $result = array( "ids"=>array_keys($index_norm), "weights"=>array_values($index_norm) ); $json = json_encode($result); echo $json.PHP_EOL; $decoded = json_decode($json, true); var_dump($decoded); echo json_encode($decoded);
Output for git.master, git.master_jit, rfc.property-hooks
{"ids":["key1","key2","key3"],"weights":["foobar","bananaramam","spam"]} array(2) { ["ids"]=> array(3) { [0]=> string(4) "key1" [1]=> string(4) "key2" [2]=> string(4) "key3" } ["weights"]=> array(3) { [0]=> string(6) "foobar" [1]=> string(11) "bananaramam" [2]=> string(4) "spam" } } {"ids":["key1","key2","key3"],"weights":["foobar","bananaramam","spam"]}

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