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('f'); ++$dolor; set_error_handler(function ($errno, $errstr, $errfile, $errline) { $args = func_get_args(); print_r($args); return true; }); ++$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(); ++$dolor;
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $lorem in /in/u8njC on line 12 Array ( [0] => 2 [1] => Undefined variable $dolor [2] => /in/u8njC [3] => 16 ) Array ( [0] => 2 [1] => Undefined variable $foo [2] => /in/u8njC [3] => 24 ) -fail: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated Array ( [0] => 2 [1] => Undefined variable $bar [2] => /in/u8njC [3] => 36 ) Array ( [0] => 2 [1] => Undefined variable $ipsum [2] => /in/u8njC [3] => 40 )

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:
54.72 ms | 402 KiB | 8 Q