3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check($function, ...$args) { try { $function(...$args); echo "okay $function\n"; } catch (ArgumentCountError $e) { echo "fail {$e->getMessage()}\n"; } } check("class_exists", "stdClass", false, 123); check("count", [], COUNT_NORMAL, 123); check("base64_encode", "string", 123); check("file_get_contents", __FILE__, false, null, 0, null, 123); check("mb_strlen", "string", "ASCII", 123); check("strlen", "string", 123);
Output for git.master, git.master_jit, rfc.property-hooks
fail class_exists() expects at most 2 arguments, 3 given fail count() expects at most 2 arguments, 3 given fail base64_encode() expects exactly 1 argument, 2 given fail file_get_contents() expects at most 5 arguments, 6 given fail mb_strlen() expects at most 2 arguments, 3 given fail strlen() expects exactly 1 argument, 2 given

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:
27.42 ms | 406 KiB | 5 Q