3v4l.org

run code in 300+ PHP versions simultaneously
<?php header('Content-type: text/plain'); $a = json_decode("[{\"id\":1, \"foo\":{\"123\": \"bar\"}}]"); $b = unserialize(serialize($a)); foreach($a[0]->foo as $name => $value) { var_dump($name, $value); $b[0]->foo->$name = "baz"; var_dump($b); }
Output for git.master_jit, git.master, rfc.property-hooks
string(3) "123" string(3) "bar" array(1) { [0]=> object(stdClass)#3 (2) { ["id"]=> int(1) ["foo"]=> object(stdClass)#4 (1) { ["123"]=> string(3) "baz" } } }

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.02 ms | 401 KiB | 8 Q