<?php
/**
* @author Lisachenko Alexander <https://twitter.com/lisachenko>
*/
class ChuckNorrisException extends Exception
{
public function __construct($message, array $trace = array(), $code = 0, Exception $previous = null)
{
parent::__construct($message, 0, $previous);
$this->file = 'Real Life';
$setter = function(array $newTrace = array()) {
/** @var $this Exception */
$this->trace = $newTrace;
var_dump($this);
};
$setter->bindTo($this, 'Exception')->__invoke($trace);
}
}
throw new ChuckNorrisException("Hello", array(
array('file' => 'Chuck Norris, level', 'line' => 99, 'class' => 'own you ', 'function' => 'with uppercut!')
));
preferences:
34.66 ms | 402 KiB | 5 Q