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();

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
152.4 ms | 1488 KiB | 10 Q