3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyJobHandlerException extends Exception { public function __construct(string $message, public readonly int $jobId, ?\Throwable $previous = null) { parent::__construct($message, previous: $previous); } } function execute_job(int $jobId) { throw new \Exception('execute_job failed'); } function runner() { $jobId = 1; try { execute_job($jobId); } catch (\Throwable $e) { throw new MyJobHandlerException('Wrapping the exception', $jobId, $e); } } runner();
Output for git.master_jit, git.master
Fatal error: Uncaught Exception: execute_job failed in /in/2pc2Z:10 Stack trace: #0 /in/2pc2Z(16): execute_job(1) #1 /in/2pc2Z(22): runner() #2 {main} Next MyJobHandlerException: Wrapping the exception in /in/2pc2Z:18 Stack trace: #0 /in/2pc2Z(22): runner() #1 {main} thrown in /in/2pc2Z on line 18
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:
25.96 ms | 405 KiB | 5 Q