3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = 'invalid json test'; try { $array = json_decode($json, true, 512, JSON_THROW_ON_ERROR); printf('Valid JSON output: %s', print_r($array, true)); } catch (\JsonException $exception) { printf('Invalid JSON input: %s', print_r($exception, true)); }
Output for git.master, git.master_jit, rfc.property-hooks
Invalid JSON input: JsonException Object ( [message:protected] => Syntax error [string:Exception:private] => [code:protected] => 4 [file:protected] => /in/UhcjK [line:protected] => 6 [trace:Exception:private] => Array ( [0] => Array ( [file] => /in/UhcjK [line] => 6 [function] => json_decode [args] => Array ( [0] => invalid json test [1] => 1 [2] => 512 [3] => 4194304 ) ) ) [previous:Exception:private] => )

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