3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() { try { throw new \RuntimeException('Test error'); } catch (\RuntimeException $e) { $error = $e; $errorClass = get_class($e); throw new $errorClass($e->getMessage()); } finally { var_dump($error->getMessage()); } } echo test();

preferences:
30.75 ms | 404 KiB | 5 Q