3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class FunkyException extends Exception { protected $errors = ['blah']; public function __construct ($message, $errors) { $this->message = $message; $this->errors = $errors; parent::__construct($message); } public function getErrors() { return $this->errors; } } try { throw new FunkyException ('test', ['this','that']); } catch (FunkyException $e) { print_r ($e->getErrors()); }
based on eSdMf