3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "'string'\n"; $r = json_decode("'string'"); var_dump($r, json_last_error(), json_last_error_msg()); echo "\"string\"\n"; $r = json_decode("\"string\""); var_dump($r, json_last_error(), json_last_error_msg()); echo "\n"; echo "100\n"; $r = json_decode("100"); // int var_dump($r, json_last_error(), json_last_error_msg()); echo "\n"; echo "1.\n"; $r = json_decode("1."); // float var_dump($r, json_last_error(), json_last_error_msg()); echo "\n"; echo "1.0\n"; $r = json_decode("1.0"); // float var_dump($r, json_last_error(), json_last_error_msg()); echo "\n"; echo ".5\n"; $r = json_decode(".5"); // float var_dump($r, json_last_error(), json_last_error_msg()); echo "\n"; echo "true\n"; $r = json_decode("true"); // bool var_dump($r, json_last_error(), json_last_error_msg());
Output for git.master, git.master_jit, rfc.property-hooks
'string' NULL int(4) string(12) "Syntax error" "string" string(6) "string" int(0) string(8) "No error" 100 int(100) int(0) string(8) "No error" 1. NULL int(4) string(12) "Syntax error" 1.0 float(1) int(0) string(8) "No error" .5 NULL int(4) string(12) "Syntax error" true bool(true) 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:
30.69 ms | 402 KiB | 8 Q