3v4l.org

run code in 300+ PHP versions simultaneously
<?php function exception_error_handler($errno, $errstr, $errfile, $errline ) { throw new ErrorException($errstr); } ++$foo; set_error_handler("exception_error_handler"); try { preg_match("/foo(+/", null); echo "+value\n"; } catch (ErrorException $e) { echo "-fail", $e->getMessage(), "\n"; } restore_error_handler(); ++$bar;

preferences:
35.16 ms | 402 KiB | 5 Q