nette/nette — pull request #1146 by enumag (2013-06-23 19:59:07+00:00)
Title: Proof of Concept: Show objects in Debugger blue screen

I don't like the fact that Nette\Diagnostics\Debugger doesn't show objects on the blue screen. Well the reason is that the necessary feature is not implemented in PHP itself.

There is an implementation by @juzna but it requires self-compiled PHP.

I've found another way to do this, which would not work for all exceptions but only for those which extends the one below. We could easily implement this for all exceptions in Nette framework and it would be forward-compatible with future PHP (assuming the feature will be implemented in PHP one day).

Also it would be possible to implement some auto-replacement for exceptions from other libraries using some autoloading hacks.

```php
class DebugException extends \Exception
{

private $trace;

public function __construct($message = "", $code = 0, Exception $previous = NULL)
{
$trace = debug_backtrace();
array_shift($trace);
$this->trace = $trace;
parent::__construct($message, $code, $previous);
}

public function getDebugTrace() {
return $this->trace;
}

}
```