3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyException extends Exception { function __construct(string $message = "", int $code = 0, Throwable $previous = null) { parent::__construct($message, $code, $previous); $this->code = ['foo']; } } try { throw new MyException(); } catch (Exception $ex) { var_dump($ex); }

preferences:
48.74 ms | 402 KiB | 5 Q