3v4l.org

run code in 300+ PHP versions simultaneously
<?php function create_function2($args, $content) { static $counter = PHP_INT_MAX; $funcname = "lambda_" . (--$counter); $rawErrorHandler = null; $rawErrorHandler = set_error_handler(function ($errno, $errstr, $errfile, $errline, $errcontext) use (&$rawErrorHandler) { var_dump($errno, $errstr, $errfile, $errline, $errcontext); if ($rawErrorHandler) { return call_user_func($rawErrorHandler, $errno, $errstr, $errfile, $errline, $errcontext); } else { return false; } }, E_WARNING); eval("function {$funcname}({$args}){{$content};}"); restore_error_handler(); return $funcname; } $f = create_function2('$a,$b', 'return $a+$b;'); var_dump($f); var_dump($f(1,2));
Output for git.master, git.master_jit, rfc.property-hooks
string(26) "lambda_9223372036854775806" int(3)

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