3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f($errno, $errstr, $errfile, $errline ) { $args = func_get_args(); print_r($args); return true; } function exception_error_handler($errno, $errstr, $errfile, $errline ) { throw new ErrorException($errstr); } ++$lorem; set_error_handler(function ($errno, $errstr, $errfile, $errline) { $args = func_get_args(); print_r($args); return true; }); ++$dolor; set_error_handler(); ++$foo; set_error_handler("exception_error_handler"); try { preg_match("/foo(+/", null); echo "+valid\n"; } catch (ErrorException $e) { echo "-fail: ", $e->getMessage(), "\n"; } restore_error_handler(); ++$bar; restore_error_handler(); ++$ipsum;
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $lorem in /in/5NeC6 on line 12 Array ( [0] => 2 [1] => Undefined variable $dolor [2] => /in/5NeC6 [3] => 20 ) Fatal error: Uncaught ArgumentCountError: set_error_handler() expects at least 1 argument, 0 given in /in/5NeC6:22 Stack trace: #0 /in/5NeC6(22): set_error_handler() #1 {main} thrown in /in/5NeC6 on line 22
Process exited with code 255.

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