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