3v4l.org

run code in 300+ PHP versions simultaneously
<?php $class = new stdClass(); $class->field = 'foo'; var_dump($class); $array = array(1 => $class); var_dump($array); $json_sting = json_encode($array); var_dump($json_sting); $array_obj = json_decode($json_sting); var_dump($array_obj); $array = (array) $array_obj; var_dump($array); var_dump($array[1]);
Output for git.master, git.master_jit, rfc.property-hooks
object(stdClass)#1 (1) { ["field"]=> string(3) "foo" } array(1) { [1]=> object(stdClass)#1 (1) { ["field"]=> string(3) "foo" } } string(21) "{"1":{"field":"foo"}}" object(stdClass)#3 (1) { ["1"]=> object(stdClass)#2 (1) { ["field"]=> string(3) "foo" } } array(1) { [1]=> object(stdClass)#2 (1) { ["field"]=> string(3) "foo" } } object(stdClass)#2 (1) { ["field"]=> string(3) "foo" }

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