- var_dump: documentation ( source)
<?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);
}