3v4l.org

run code in 500+ PHP versions simultaneously
<?php define('DO_RETURN', false); function execute() { try { throw new \Exception('root exception'); // throws exception } catch (\Throwable $e) { echo "[catch]"; // exception is handled somehow throw $e; // and rethrown return; // never called } finally { echo "[finally]"; // finally is handed if (DO_RETURN) return; // if return is here the thrown exception is ignored and silently scratched } } execute(); // the exception was rethrown, so should be thrown after finally

preferences:
22.25 ms | 474 KiB | 4 Q