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; restore_error_handler(); ++$sit;
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $lorem in /in/pEgZY on line 12 Array ( [0] => 2 [1] => Undefined variable $dolor [2] => /in/pEgZY [3] => 20 ) Fatal error: Uncaught ArgumentCountError: set_error_handler() expects at least 1 argument, 0 given in /in/pEgZY:22 Stack trace: #0 /in/pEgZY(22): set_error_handler() #1 {main} thrown in /in/pEgZY 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:
36.36 ms | 401 KiB | 8 Q