3v4l.org

run code in 300+ PHP versions simultaneously
<?php $so = new \stdClass; $so->a = 1; $obj = new \stdClass(); $obj->z = $so; $arr = array(new \stdClass(), array('a' => 1, 'b' => $so, 'c' => $obj), $so); $result = @json_encode($arr, 0, 5); var_dump($result, json_last_error(), json_last_error_msg());
Output for git.master, git.master_jit, rfc.property-hooks
string(50) "[{},{"a":1,"b":{"a":1},"c":{"z":{"a":1}}},{"a":1}]" int(0) string(8) "No error"

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:
45.83 ms | 401 KiB | 8 Q