src/BaseException.php
public static function displayException(\Throwable $Throwable){

		$muted = false;

		if($Throwable instanceof Silenced){

			$muted = true;
		}

		ob_start();

		?>

		<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
			"http://www.w3.org/TR/html4/strict.dtd">

		<!--suppress HtmlUnknownTag -->
		<html>
		<head>
			<title>
				<?php

				if($Throwable instanceof PHPAssertionFailed){

					?>
					Assertion Failed in <?= basename($Throwable->getFile()) ?>
					on line <?= $Throwable->getLine() ?>
					<?php

				}
				else{

					$exception_parts = explode(
						'\\',
						get_class(
							$Throwable
						)
					);
					echo end($exception_parts);

					?> in
					<?= basename($Throwable->getFile()) ?> on line
					<?= $Throwable->getLine() ?>
					<?php

				}

				?>
			</title>
			<script type="text/javascript"
			        src="https://ajax.googleapis.com/ajax/libs/mootools/1.4.5/mootools-yui-compressed.js"></script>
			<script type="text/javascript">

				document.addEvent('domready', function(){

					var toggle = function(){

						var emote = $('Emote');

						var mouth = emote.get('text').charAt(0);
						var eyes = emote.get('text').charAt(1);

						if(eyes === ';'){

							eyes = ':';
						}else{

							eyes = ';';
						}

						emote.set('text', mouth + eyes);
					};

					var blink = function(){

						toggle();
						toggle.delay(120 + (240 * Math.random()));
					};

					var animate = function(){

						blink();

						animate.delay((4200 * Math.random()) + 1200);
					};

					animate.delay(1500);
				});

				document.addEvent('click:relay(span.Arg)', function(event){

					var element = $(event.target).getParent().getElement('code');

					if(element.retrieve('forced')){

						element.store('forced', false);

						element.setStyle('display', 'none');
						element.setStyle('overflow', 'hidden');
					}else{

						element.store('forced', true);

						element.setStyle('display', 'block');
						element.setStyle('overflow', 'scroll');
					}

				});

				var hoverToggle = function(event){

					return function(element){

						if(event === 'mouseover'){

							element.setStyle('display', 'block');
						}

						else
							if(event === 'mouseout'){

								element.setStyle('display', 'none');
							}
					};
				};

				var hoverOver = hoverToggle('mouseover');
				var hoverOut = hoverToggle('mouseout');

				document.addEvent('mouseover:relay(span.Function)', function(event){

					var element = $(event.target).getParent().getElement('table');

					hoverOver(element);
				});

				document.addEvent('mouseout:relay(span.Function)', function(event){

					var element = $(event.target).getParent().getElement('table');

					hoverOut(element);
				});

				document.addEvent('mouseover:relay(span.Arg)', function(event){

					var element = $(event.target).getParent().getElement('code');

					if(element.retrieve('forced')) return;

					hoverOver(element);
				});

				document.addEvent('mouseout:relay(span.Arg)', function(event){

					var element = $(event.target).getParent().getElement('code');

					if(element.retrieve('forced')) return;

					hoverOut(element);
				});

			</script>
			<style type="text/css">
				body {
					font-family: Segoe UI, Arial, sans-serif;
					cursor: default;
				}

				h1 {
					margin-top: 5px;
					font-size: 48px;
				}

				h1 .Emote {
					color: maroon;
					position: relative;
					left: 8px;
					top: 1px;
					font-size: 72px;
					margin-right: 16px;
				}

				h1 em {
					color: graytext;
					font-style: normal;
					font-weight: normal;
				}

				h2 {
					font-size: 20px;
				}

				a {
					text-decoration: none;
				}

				a:hover {
					text-decoration: underline;
					color: blue;
				}

				td {
					vertical-align: top;
				}

				.Hidden {
					display: none;
				}

				span.Boolean {
					font-style: italic;
				}

				.ErrorMessage {
					margin-left: -20px;
					font-size: 12px;
					border-spacing: 20px 5px;
				}

				.ErrorMessage td:nth-child(1),
				.Environment td:nth-child(1) {
					font-weight: bold;
					white-space: nowrap;
				}

				.ErrorMessage ul.ExceptionTree {
					margin-top: 0;
					margin-left: -40px;
					list-style-type: none;
				}

				.ErrorMessage ul.ExceptionTree li {
					float: left;
				}

				.ErrorMessage ul.ExceptionTree li.Parent:after {
					content: "\00bb";
					padding-left: 4px;
					padding-right: 4px;
					font-weight: bold;
					color: graytext;
				}

				.ErrorMessage ul.ExceptionTree li.Exception {
					color: red;
					text-decoration: underline;
					font-weight: bold;
				}

				.ErrorMessage ul.ExceptionTree li.Exception strong {
					color: black;
				}

				.ErrorMessage tr.Message td {
					max-width: 720px;
				}

				ul.TraceItem {
					font-size: 12px;
				}

				ul.TraceItem li.Function {
					float: left;
					list-style-type: circle;
					padding: 0;
					margin-left: -10px;
				}

				ul.TraceItem li.Arg {
					float: left;
					list-style-type: none;
					padding: 0 5px;
				}

				ul.TraceItem .Elem {
					margin-top: 10px;
					margin-left: 10px;
					font-size: 11px;
					padding: 0;
					list-style-type: square;
					display: none;
					color: black;
					position: absolute;
					border: 1px solid black;
					background-color: infobackground;
					border-spacing: 10px 2px;
					max-width: 60%;
					max-height: 40%;
					overflow: hidden;
				}

				ul.TraceItem code.Elem {
					font-family: Lucida Console, monospace;
					margin: 0;
					font-size: 10px;
					padding: 4px 6px;
					white-space: pre;
				}

				ul.TraceItem table td:nth-child(1) {
					color: grey;
				}

				ul.TraceItem li.Arg {
					color: maroon;
				}

				ul.TraceItem li.Arg:after {
					content: ", ";
				}

				ul.TraceItem li.Arg:last-child:after {
					content: none;
				}

				ul.TraceItem li.Arg:hover span.Arg {
					color: red;
					cursor: pointer;
				}

				ul.TraceItem li.Function {
					color: navy;
				}

				ul.TraceItem li.Function:hover span.Function {
					color: blue;
				}

				li.Function:after {
					content: " (";
				}

				ul.TraceItem:after {
					content: " )";
				}
			</style>
		</head>

		<body>

		<?php

		// Assertion

		if($Throwable instanceof PHPAssertionFailed){

			?>
			<h1>
				<strong id="Emote" class="Emote">\:</strong>
				Assertion&middot;Failed
			</h1>
			<?php

		}

		// Exception

		else{

			?>
			<h1>
				<strong id="Emote" class="Emote">):</strong>
				<?php

				$exception_parts = explode(
					'\\',
					get_class(
						$Throwable
					)
				);
				$base = end($exception_parts);

				// Split name at capital letter boundaries

				$base_parts = preg_split(
					'/([A-Z]+[a-z]+)/',
					$base,
					-1,
					PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY
				);

				$final = array_pop($base_parts);

				if(!empty($base_parts)){

					echo implode('&middot;', $base_parts)

					?>
					<em>&middot;<?= $final ?></em>
					<?php
				}

				else{

					echo $final;
				}
				?>
			</h1>
			<?php

		}

		?>

		<table class="ErrorMessage">
			<tr>
				<td>Origin:</td>
				<td>
					<?= $Throwable->getFile() ?>
					<strong>&lt;<?= $Throwable->getLine() ?>&gt;</strong>
				</td>
			</tr>
			<?php

			if(!($Throwable instanceof PHPAssertionFailed)){

				?>
				<tr>
					<td>Type:</td>
					<td>

						<ul class="ExceptionTree">

							<?php

							// Exception Tree

							$exception_tree = BaseException::getExceptionTree(
								$Throwable
							);

							foreach($exception_tree as $key => $exception){

								// Exception thrown

								if($key + 1 == count($exception_tree)){

									?>

									<li class="Exception">
										<strong><?= $exception ?></strong>
									</li>

									<?php

								}

								// Parent exceptions

								else{

									?>

									<li class="Parent">
										<?= self::getShortName(
											$exception
										) ?></li>

									<?php

								}
							}

							?>

						</ul>

					</td>
				</tr>
				<?php

			}

			?>

			<?php

			// Assertion

			if($Throwable instanceof PHPAssertionFailed){

				$expression = $Throwable->getExpression();

				if($expression == ''){
					$expression = 'false';
				}

				?>
				<tr>
					<td>Expression:</td>
					<td><?php

						$expression =
							highlight_string("<?php $expression ?>", true);
						$expression = str_replace(
							['&lt;?php&nbsp;', '?&gt;'],
							'',
							$expression
						);

						echo $expression;

						?></td>
				</tr>
				<?php

			}

			// Exception

			else{

				?>
				<tr class="Message">
					<td>Message:</td>
					<td><?= htmlspecialchars(
							$Throwable->getMessage(),
							ENT_COMPAT | ENT_HTML401,
							DEFAULT_CHARSET
						) ?></td>
				</tr>
				<?

			}

			?>

		</table>

		<?php

		// Only show stack-trace on local system (IPv4, IPv6, DNS)

		if(!empty($_SERVER['REMOTE_ADDR']) &&
			in_array(
				$_SERVER['REMOTE_ADDR'],
				['127.0.0.1', '::1', 'localhost']
			)){

			?>

			<h2>Stack Trace</h2>

			<?php

			if($Throwable instanceof BaseException ||
				$Throwable instanceof PHPErrorException){

				/** @noinspection PhpUndefinedMethodInspection */

				$trace = $Throwable->getStackTrace();
			}
			else{

				$trace = array_reverse($Throwable->getTrace());
			}

			foreach($trace as $trace_item){

				if(strpos($trace_item['function'], '{closure}') !== false){

					$trace_item['function'] = '{closure}';
				}

				?>

				<ul class="TraceItem">
					<li class="Function">
						<span class="Function"><?=
							(isset($trace_item['class']) ?
								self::getShortName($trace_item['class']) : '') .
							(isset($trace_item['type']) ? $trace_item['type'] :
								'') .
							(isset($trace_item['function']) ?
								$trace_item['function'] : '')
							?></span>
						<table class="Elem">
							<tr>
								<td>FQN:</td>
								<td><?=
									(isset($trace_item['class']) ?
										$trace_item['class'] : '') .
									(isset($trace_item['type']) ?
										$trace_item['type'] : '') .
									(isset($trace_item['function']) ?
										$trace_item['function'] : '')
									?>()
								</td>
							</tr>
							<tr>
								<td>File:</td>
								<td><?= (isset($trace_item['file']) ?
										basename($trace_item['file']) :
										'') ?></td>
							</tr>
							<tr>
								<td>Line:</td>
								<td><?= (isset($trace_item['line']) ?
										$trace_item['line'] : '') ?></td>
							</tr>
							<tr>
								<td>Directory:</td>
								<td><?= (isset($trace_item['file']) ?
										dirname($trace_item['file']) :
										'') ?></td>
							</tr>
						</table>
					</li>

					<?php

					foreach((array) $trace_item['args'] as $arg){

						$arg_boolean = false;
						$arg_black = '';
						$arg_red = '';

						// String

						if(is_string($arg)){

							$arg_black = '[' . strlen($arg) . ']';
							$arg_red = gettype($arg);
						}

						// Array

						elseif(is_array($arg)){

							if(count($arg) > 0){

								$arg_black = '[' . count($arg) . ']';
								$arg_red = gettype($arg);
							}
							else{

								$arg_black = 'array[0]';
							}
						}

						// Boolean

						elseif(is_bool($arg)){

							$arg_boolean = true;
							$arg_black = ($arg ? 'true' : 'false');
						}

						// NULL

						elseif(is_null($arg)){

							$arg_boolean = true;
							$arg_black = 'null';
						}

						// Number

						elseif(is_int($arg) || is_float($arg)){

							$arg_black = $arg;
						}

						// Object

						elseif(is_object($arg)){

							$arg_black = '';

							// Treat "silent" classes as a scalar value

							if($arg instanceof Silenced){

								$arg_black = BaseException::getShortName(
									get_class($arg)
								);
							}

							if($arg_black == ''){

								$arg_red = BaseException::getShortName(
									get_class($arg)
								);
							}
						}

						// Other

						else{

							$arg_red = gettype($arg);
						}

						?>

						<li class="Arg">

								<span class="<?= ($muted ? '' : 'Arg') ?>">
									<?= $arg_red ?>
								</span><?php

							if($arg_boolean){

								?>

								<span class="Boolean"><?= $arg_black ?></span>

								<?php

							}
							else{

								echo $arg_black;
							}

							// Argument Details

							if($arg_red && !$muted){

								?>

								<code class="Elem"><?= htmlspecialchars(
										print_r($arg, true),
										ENT_COMPAT | ENT_HTML401,
										DEFAULT_CHARSET
									); ?></code>

								<?php
							}

							?>

						</li>

						<?php

					}

					?>

				</ul>
				<br class="Hidden">

				<?php

			}
		}

		?>

		<h2>Environment</h2>

		<table class="ErrorMessage">
			<tr>
				<td>PHP:</td>
				<td><?= PHP_VERSION ?> (<?= PHP_SAPI ?>)</td>
			</tr>
			<?php

			if(isset($_SERVER['SERVER_SOFTWARE'])){

				?>

				<tr>
					<td>Server:</td>
					<td><?= $_SERVER['SERVER_SOFTWARE'] ?></td>
				</tr>

				<?php

			}

			?>
			<tr>
				<td>Time:</td>
				<td><?= date('d-m-Y H:i:s') ?></td>
			</tr>
		</table>

		</body>
		</html>

		<?php

		return ob_get_clean();
	}
public static function displayException(\Throwable $Throwable){

		$muted = false;

		if($Throwable instanceof Silenced){

			$muted = true;
		}

		ob_start();

		?>

		<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
			"http://www.w3.org/TR/html4/strict.dtd">

		<!--suppress HtmlUnknownTag -->
		<html>
		<head>
			<title>
				<?php

				if($Throwable instanceof PHPAssertionFailed){

					?>
					Assertion Failed in <?= basename($Throwable->getFile()) ?>
					on line <?= $Throwable->getLine() ?>
					<?php

				}
				else{

					$exception_parts = explode(
						'\\',
						get_class(
							$Throwable
						)
					);
					echo end($exception_parts);

					?> in
					<?= basename($Throwable->getFile()) ?> on line
					<?= $Throwable->getLine() ?>
					<?php

				}

				?>
			</title>
			<script type="text/javascript"
			        src="https://ajax.googleapis.com/ajax/libs/mootools/1.4.5/mootools-yui-compressed.js"></script>
			<script type="text/javascript">

				document.addEvent('domready', function(){

					var toggle = function(){

						var emote = $('Emote');

						var mouth = emote.get('text').charAt(0);
						var eyes = emote.get('text').charAt(1);

						if(eyes === ';'){

							eyes = ':';
						}else{

							eyes = ';';
						}

						emote.set('text', mouth + eyes);
					};

					var blink = function(){

						toggle();
						toggle.delay(120 + (240 * Math.random()));
					};

					var animate = function(){

						blink();

						animate.delay((4200 * Math.random()) + 1200);
					};

					animate.delay(1500);
				});

				document.addEvent('click:relay(span.Arg)', function(event){

					var element = $(event.target).getParent().getElement('code');

					if(element.retrieve('forced')){

						element.store('forced', false);

						element.setStyle('display', 'none');
						element.setStyle('overflow', 'hidden');
					}else{

						element.store('forced', true);

						element.setStyle('display', 'block');
						element.setStyle('overflow', 'scroll');
					}

				});

				var hoverToggle = function(event){

					return function(element){

						if(event === 'mouseover'){

							element.setStyle('display', 'block');
						}

						else
							if(event === 'mouseout'){

								element.setStyle('display', 'none');
							}
					};
				};

				var hoverOver = hoverToggle('mouseover');
				var hoverOut = hoverToggle('mouseout');

				document.addEvent('mouseover:relay(span.Function)', function(event){

					var element = $(event.target).getParent().getElement('table');

					hoverOver(element);
				});

				document.addEvent('mouseout:relay(span.Function)', function(event){

					var element = $(event.target).getParent().getElement('table');

					hoverOut(element);
				});

				document.addEvent('mouseover:relay(span.Arg)', function(event){

					var element = $(event.target).getParent().getElement('code');

					if(element.retrieve('forced')) return;

					hoverOver(element);
				});

				document.addEvent('mouseout:relay(span.Arg)', function(event){

					var element = $(event.target).getParent().getElement('code');

					if(element.retrieve('forced')) return;

					hoverOut(element);
				});

			</script>
			<style type="text/css">
				body {
					font-family: Segoe UI, Arial, sans-serif;
					cursor: default;
				}

				h1 {
					margin-top: 5px;
					font-size: 48px;
				}

				h1 .Emote {
					color: maroon;
					position: relative;
					left: 8px;
					top: 1px;
					font-size: 72px;
					margin-right: 16px;
				}

				h1 em {
					color: graytext;
					font-style: normal;
					font-weight: normal;
				}

				h2 {
					font-size: 20px;
				}

				a {
					text-decoration: none;
				}

				a:hover {
					text-decoration: underline;
					color: blue;
				}

				td {
					vertical-align: top;
				}

				.Hidden {
					display: none;
				}

				span.Boolean {
					font-style: italic;
				}

				.ErrorMessage {
					margin-left: -20px;
					font-size: 12px;
					border-spacing: 20px 5px;
				}

				.ErrorMessage td:nth-child(1),
				.Environment td:nth-child(1) {
					font-weight: bold;
					white-space: nowrap;
				}

				.ErrorMessage ul.ExceptionTree {
					margin-top: 0;
					margin-left: -40px;
					list-style-type: none;
				}

				.ErrorMessage ul.ExceptionTree li {
					float: left;
				}

				.ErrorMessage ul.ExceptionTree li.Parent:after {
					content: "\00bb";
					padding-left: 4px;
					padding-right: 4px;
					font-weight: bold;
					color: graytext;
				}

				.ErrorMessage ul.ExceptionTree li.Exception {
					color: red;
					text-decoration: underline;
					font-weight: bold;
				}

				.ErrorMessage ul.ExceptionTree li.Exception strong {
					color: black;
				}

				.ErrorMessage tr.Message td {
					max-width: 720px;
				}

				ul.TraceItem {
					font-size: 12px;
				}

				ul.TraceItem li.Function {
					float: left;
					list-style-type: circle;
					padding: 0;
					margin-left: -10px;
				}

				ul.TraceItem li.Arg {
					float: left;
					list-style-type: none;
					padding: 0 5px;
				}

				ul.TraceItem .Elem {
					margin-top: 10px;
					margin-left: 10px;
					font-size: 11px;
					padding: 0;
					list-style-type: square;
					display: none;
					color: black;
					position: absolute;
					border: 1px solid black;
					background-color: infobackground;
					border-spacing: 10px 2px;
					max-width: 60%;
					max-height: 40%;
					overflow: hidden;
				}

				ul.TraceItem code.Elem {
					font-family: Lucida Console, monospace;
					margin: 0;
					font-size: 10px;
					padding: 4px 6px;
					white-space: pre;
				}

				ul.TraceItem table td:nth-child(1) {
					color: grey;
				}

				ul.TraceItem li.Arg {
					color: maroon;
				}

				ul.TraceItem li.Arg:after {
					content: ", ";
				}

				ul.TraceItem li.Arg:last-child:after {
					content: none;
				}

				ul.TraceItem li.Arg:hover span.Arg {
					color: red;
					cursor: pointer;
				}

				ul.TraceItem li.Function {
					color: navy;
				}

				ul.TraceItem li.Function:hover span.Function {
					color: blue;
				}

				li.Function:after {
					content: " (";
				}

				ul.TraceItem:after {
					content: " )";
				}
			</style>
		</head>

		<body>

		<?php

		// Assertion

		if($Throwable instanceof PHPAssertionFailed){

			?>
			<h1>
				<strong id="Emote" class="Emote">\:</strong>
				Assertion&middot;Failed
			</h1>
			<?php

		}

		// Exception

		else{

			?>
			<h1>
				<strong id="Emote" class="Emote">):</strong>
				<?php

				$exception_parts = explode(
					'\\',
					get_class(
						$Throwable
					)
				);
				$base = end($exception_parts);

				// Split name at capital letter boundaries

				$base_parts = preg_split(
					'/([A-Z]+[a-z]+)/',
					$base,
					-1,
					PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY
				);

				$final = array_pop($base_parts);

				if(!empty($base_parts)){

					echo implode('&middot;', $base_parts)

					?>
					<em>&middot;<?= $final ?></em>
					<?php
				}

				else{

					echo $final;
				}
				?>
			</h1>
			<?php

		}

		?>

		<table class="ErrorMessage">
			<tr>
				<td>Origin:</td>
				<td>
					<?= $Throwable->getFile() ?>
					<strong>&lt;<?= $Throwable->getLine() ?>&gt;</strong>
				</td>
			</tr>
			<?php

			if(!($Throwable instanceof PHPAssertionFailed)){

				?>
				<tr>
					<td>Type:</td>
					<td>

						<ul class="ExceptionTree">

							<?php

							// Exception Tree

							$exception_tree = BaseException::getExceptionTree(
								$Throwable
							);

							foreach($exception_tree as $key => $exception){

								// Exception thrown

								if($key + 1 == count($exception_tree)){

									?>

									<li class="Exception">
										<strong><?= $exception ?></strong>
									</li>

									<?php

								}

								// Parent exceptions

								else{

									?>

									<li class="Parent">
										<?= self::getShortName(
											$exception
										) ?></li>

									<?php

								}
							}

							?>

						</ul>

					</td>
				</tr>
				<?php

			}

			?>

			<?php

			// Assertion

			if($Throwable instanceof PHPAssertionFailed){

				$expression = $Throwable->getExpression();

				if($expression == ''){
					$expression = 'false';
				}

				?>
				<tr>
					<td>Expression:</td>
					<td><?php

						$expression =
							highlight_string("<?php $expression ?>", true);
						$expression = str_replace(
							['&lt;?php&nbsp;', '?&gt;'],
							'',
							$expression
						);

						echo $expression;

						?></td>
				</tr>
				<?php

			}

			// Exception

			else{

				?>
				<tr class="Message">
					<td>Message:</td>
					<td><?= htmlspecialchars(
							$Throwable->getMessage(),
							ENT_COMPAT | ENT_HTML401,
							DEFAULT_CHARSET
						) ?></td>
				</tr>
				<?

			}

			?>

		</table>

		<?php

		// Only show stack-trace on local system (IPv4, IPv6, DNS)

		if(!empty($_SERVER['REMOTE_ADDR']) &&
			in_array(
				$_SERVER['REMOTE_ADDR'],
				['127.0.0.1', '::1', 'localhost']
			)){

			?>

			<h2>Stack Trace</h2>

			<?php

			if($Throwable instanceof BaseException ||
				$Throwable instanceof PHPErrorException){

				/** @noinspection PhpUndefinedMethodInspection */

				$trace = $Throwable->getStackTrace();
			}
			else{

				$trace = array_reverse($Throwable->getTrace());
			}

			foreach($trace as $trace_item){

				if(strpos($trace_item['function'], '{closure}') !== false){

					$trace_item['function'] = '{closure}';
				}

				?>

				<ul class="TraceItem">
					<li class="Function">
						<span class="Function"><?=
							(isset($trace_item['class']) ?
								self::getShortName($trace_item['class']) : '') .
							(isset($trace_item['type']) ? $trace_item['type'] :
								'') .
							(isset($trace_item['function']) ?
								$trace_item['function'] : '')
							?></span>
						<table class="Elem">
							<tr>
								<td>FQN:</td>
								<td><?=
									(isset($trace_item['class']) ?
										$trace_item['class'] : '') .
									(isset($trace_item['type']) ?
										$trace_item['type'] : '') .
									(isset($trace_item['function']) ?
										$trace_item['function'] : '')
									?>()
								</td>
							</tr>
							<tr>
								<td>File:</td>
								<td><?= (isset($trace_item['file']) ?
										basename($trace_item['file']) :
										'') ?></td>
							</tr>
							<tr>
								<td>Line:</td>
								<td><?= (isset($trace_item['line']) ?
										$trace_item['line'] : '') ?></td>
							</tr>
							<tr>
								<td>Directory:</td>
								<td><?= (isset($trace_item['file']) ?
										dirname($trace_item['file']) :
										'') ?></td>
							</tr>
						</table>
					</li>

					<?php

					foreach((array) $trace_item['args'] as $arg){

						$arg_boolean = false;
						$arg_black = '';
						$arg_red = '';

						// String

						if(is_string($arg)){

							$arg_black = '[' . strlen($arg) . ']';
							$arg_red = gettype($arg);
						}

						// Array

						elseif(is_array($arg)){

							if(count($arg) > 0){

								$arg_black = '[' . count($arg) . ']';
								$arg_red = gettype($arg);
							}
							else{

								$arg_black = 'array[0]';
							}
						}

						// Boolean

						elseif(is_bool($arg)){

							$arg_boolean = true;
							$arg_black = ($arg ? 'true' : 'false');
						}

						// NULL

						elseif(is_null($arg)){

							$arg_boolean = true;
							$arg_black = 'null';
						}

						// Number

						elseif(is_int($arg) || is_float($arg)){

							$arg_black = $arg;
						}

						// Object

						elseif(is_object($arg)){

							$arg_black = '';

							// Treat "silent" classes as a scalar value

							if($arg instanceof Silenced){

								$arg_black = BaseException::getShortName(
									get_class($arg)
								);
							}

							if($arg_black == ''){

								$arg_red = BaseException::getShortName(
									get_class($arg)
								);
							}
						}

						// Other

						else{

							$arg_red = gettype($arg);
						}

						?>

						<li class="Arg">

								<span class="<?= ($muted ? '' : 'Arg') ?>">
									<?= $arg_red ?>
								</span><?php

							if($arg_boolean){

								?>

								<span class="Boolean"><?= $arg_black ?></span>

								<?php

							}
							else{

								echo $arg_black;
							}

							// Argument Details

							if($arg_red && !$muted){

								?>

								<code class="Elem"><?= htmlspecialchars(
										print_r($arg, true),
										ENT_COMPAT | ENT_HTML401,
										DEFAULT_CHARSET
									); ?></code>

								<?php
							}

							?>

						</li>

						<?php

					}

					?>

				</ul>
				<br class="Hidden">

				<?php

			}
		}

		?>

		<h2>Environment</h2>

		<table class="ErrorMessage">
			<tr>
				<td>PHP:</td>
				<td><?= PHP_VERSION ?> (<?= PHP_SAPI ?>)</td>
			</tr>
			<?php

			if(isset($_SERVER['SERVER_SOFTWARE'])){

				?>

				<tr>
					<td>Server:</td>
					<td><?= $_SERVER['SERVER_SOFTWARE'] ?></td>
				</tr>

				<?php

			}

			?>
			<tr>
				<td>Time:</td>
				<td><?= date('d-m-Y H:i:s') ?></td>
			</tr>
		</table>

		</body>
		</html>

		<?php

		return ob_get_clean();
	}
public static function displayException ( \ Throwable $ Throwable ) { $ muted = false ; if ( $ Throwable instanceof Silenced ) { $ muted = true ; } ob_start ( ) ; ?>

		<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
			"http://www.w3.org/TR/html4/strict.dtd">

		<!--suppress HtmlUnknownTag -->
		<html>
		<head>
			<title>
				<?php if ( $ Throwable instanceof PHPAssertionFailed ) { ?>
					Assertion Failed in <?= basename ( $ Throwable -> getFile ( ) ) ?>
					on line <?= $ Throwable -> getLine ( ) ?>
					<?php } else { $ exception_parts = explode ( '\\' , get_class ( $ Throwable ) ) ; echo end ( $ exception_parts ) ; ?> in
					<?= basename ( $ Throwable -> getFile ( ) ) ?> on line
					<?= $ Throwable -> getLine ( ) ?>
					<?php } ?>
			</title>
			<script type="text/javascript"
			        src="https://ajax.googleapis.com/ajax/libs/mootools/1.4.5/mootools-yui-compressed.js"></script>
			<script type="text/javascript">

				document.addEvent('domready', function(){

					var toggle = function(){

						var emote = $('Emote');

						var mouth = emote.get('text').charAt(0);
						var eyes = emote.get('text').charAt(1);

						if(eyes === ';'){

							eyes = ':';
						}else{

							eyes = ';';
						}

						emote.set('text', mouth + eyes);
					};

					var blink = function(){

						toggle();
						toggle.delay(120 + (240 * Math.random()));
					};

					var animate = function(){

						blink();

						animate.delay((4200 * Math.random()) + 1200);
					};

					animate.delay(1500);
				});

				document.addEvent('click:relay(span.Arg)', function(event){

					var element = $(event.target).getParent().getElement('code');

					if(element.retrieve('forced')){

						element.store('forced', false);

						element.setStyle('display', 'none');
						element.setStyle('overflow', 'hidden');
					}else{

						element.store('forced', true);

						element.setStyle('display', 'block');
						element.setStyle('overflow', 'scroll');
					}

				});

				var hoverToggle = function(event){

					return function(element){

						if(event === 'mouseover'){

							element.setStyle('display', 'block');
						}

						else
							if(event === 'mouseout'){

								element.setStyle('display', 'none');
							}
					};
				};

				var hoverOver = hoverToggle('mouseover');
				var hoverOut = hoverToggle('mouseout');

				document.addEvent('mouseover:relay(span.Function)', function(event){

					var element = $(event.target).getParent().getElement('table');

					hoverOver(element);
				});

				document.addEvent('mouseout:relay(span.Function)', function(event){

					var element = $(event.target).getParent().getElement('table');

					hoverOut(element);
				});

				document.addEvent('mouseover:relay(span.Arg)', function(event){

					var element = $(event.target).getParent().getElement('code');

					if(element.retrieve('forced')) return;

					hoverOver(element);
				});

				document.addEvent('mouseout:relay(span.Arg)', function(event){

					var element = $(event.target).getParent().getElement('code');

					if(element.retrieve('forced')) return;

					hoverOut(element);
				});

			</script>
			<style type="text/css">
				body {
					font-family: Segoe UI, Arial, sans-serif;
					cursor: default;
				}

				h1 {
					margin-top: 5px;
					font-size: 48px;
				}

				h1 .Emote {
					color: maroon;
					position: relative;
					left: 8px;
					top: 1px;
					font-size: 72px;
					margin-right: 16px;
				}

				h1 em {
					color: graytext;
					font-style: normal;
					font-weight: normal;
				}

				h2 {
					font-size: 20px;
				}

				a {
					text-decoration: none;
				}

				a:hover {
					text-decoration: underline;
					color: blue;
				}

				td {
					vertical-align: top;
				}

				.Hidden {
					display: none;
				}

				span.Boolean {
					font-style: italic;
				}

				.ErrorMessage {
					margin-left: -20px;
					font-size: 12px;
					border-spacing: 20px 5px;
				}

				.ErrorMessage td:nth-child(1),
				.Environment td:nth-child(1) {
					font-weight: bold;
					white-space: nowrap;
				}

				.ErrorMessage ul.ExceptionTree {
					margin-top: 0;
					margin-left: -40px;
					list-style-type: none;
				}

				.ErrorMessage ul.ExceptionTree li {
					float: left;
				}

				.ErrorMessage ul.ExceptionTree li.Parent:after {
					content: "\00bb";
					padding-left: 4px;
					padding-right: 4px;
					font-weight: bold;
					color: graytext;
				}

				.ErrorMessage ul.ExceptionTree li.Exception {
					color: red;
					text-decoration: underline;
					font-weight: bold;
				}

				.ErrorMessage ul.ExceptionTree li.Exception strong {
					color: black;
				}

				.ErrorMessage tr.Message td {
					max-width: 720px;
				}

				ul.TraceItem {
					font-size: 12px;
				}

				ul.TraceItem li.Function {
					float: left;
					list-style-type: circle;
					padding: 0;
					margin-left: -10px;
				}

				ul.TraceItem li.Arg {
					float: left;
					list-style-type: none;
					padding: 0 5px;
				}

				ul.TraceItem .Elem {
					margin-top: 10px;
					margin-left: 10px;
					font-size: 11px;
					padding: 0;
					list-style-type: square;
					display: none;
					color: black;
					position: absolute;
					border: 1px solid black;
					background-color: infobackground;
					border-spacing: 10px 2px;
					max-width: 60%;
					max-height: 40%;
					overflow: hidden;
				}

				ul.TraceItem code.Elem {
					font-family: Lucida Console, monospace;
					margin: 0;
					font-size: 10px;
					padding: 4px 6px;
					white-space: pre;
				}

				ul.TraceItem table td:nth-child(1) {
					color: grey;
				}

				ul.TraceItem li.Arg {
					color: maroon;
				}

				ul.TraceItem li.Arg:after {
					content: ", ";
				}

				ul.TraceItem li.Arg:last-child:after {
					content: none;
				}

				ul.TraceItem li.Arg:hover span.Arg {
					color: red;
					cursor: pointer;
				}

				ul.TraceItem li.Function {
					color: navy;
				}

				ul.TraceItem li.Function:hover span.Function {
					color: blue;
				}

				li.Function:after {
					content: " (";
				}

				ul.TraceItem:after {
					content: " )";
				}
			</style>
		</head>

		<body>

		<?php // Assertion if ( $ Throwable instanceof PHPAssertionFailed ) { ?>
			<h1>
				<strong id="Emote" class="Emote">\:</strong>
				Assertion&middot;Failed
			</h1>
			<?php } // Exception else { ?>
			<h1>
				<strong id="Emote" class="Emote">):</strong>
				<?php $ exception_parts = explode ( '\\' , get_class ( $ Throwable ) ) ; $ base = end ( $ exception_parts ) ; // Split name at capital letter boundaries $ base_parts = preg_split ( '/([A-Z]+[a-z]+)/' , $ base , - 1 , PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY ) ; $ final = array_pop ( $ base_parts ) ; if ( ! empty ( $ base_parts ) ) { echo implode ( '&middot;' , $ base_parts ) ?>
					<em>&middot;<?= $ final ?></em>
					<?php } else { echo $ final ; } ?>
			</h1>
			<?php } ?>

		<table class="ErrorMessage">
			<tr>
				<td>Origin:</td>
				<td>
					<?= $ Throwable -> getFile ( ) ?>
					<strong>&lt;<?= $ Throwable -> getLine ( ) ?>&gt;</strong>
				</td>
			</tr>
			<?php if ( ! ( $ Throwable instanceof PHPAssertionFailed ) ) { ?>
				<tr>
					<td>Type:</td>
					<td>

						<ul class="ExceptionTree">

							<?php // Exception Tree $ exception_tree = BaseException :: getExceptionTree ( $ Throwable ) ; foreach ( $ exception_tree as $ key => $ exception ) { // Exception thrown if ( $ key + 1 == count ( $ exception_tree ) ) { ?>

									<li class="Exception">
										<strong><?= $ exception ?></strong>
									</li>

									<?php } // Parent exceptions else { ?>

									<li class="Parent">
										<?= self :: getShortName ( $ exception ) ?></li>

									<?php } } ?>

						</ul>

					</td>
				</tr>
				<?php } ?>

			<?php // Assertion if ( $ Throwable instanceof PHPAssertionFailed ) { $ expression = $ Throwable -> getExpression ( ) ; if ( $ expression == '' ) { $ expression = 'false' ; } ?>
				<tr>
					<td>Expression:</td>
					<td><?php $ expression = highlight_string ( "<?php $expression ?>" , true ) ; $ expression = str_replace ( [ '&lt;?php&nbsp;' , '?&gt;' ] , '' , $ expression ) ; echo $ expression ; ?></td>
				</tr>
				<?php } // Exception else { ?>
				<tr class="Message">
					<td>Message:</td>
					<td><?= htmlspecialchars ( $ Throwable -> getMessage ( ) , ENT_COMPAT | ENT_HTML401 , DEFAULT_CHARSET ) ?> < / td > < / tr > < ? } ?>

		</table>

		<?php // Only show stack-trace on local system (IPv4, IPv6, DNS) if ( ! empty ( $ _SERVER [ 'REMOTE_ADDR' ] ) && in_array ( $ _SERVER [ 'REMOTE_ADDR' ] , [ '127.0.0.1' , '::1' , 'localhost' ] ) ) { ?>

			<h2>Stack Trace</h2>

			<?php if ( $ Throwable instanceof BaseException || $ Throwable instanceof PHPErrorException ) { /** @noinspection PhpUndefinedMethodInspection */ $ trace = $ Throwable -> getStackTrace ( ) ; } else { $ trace = array_reverse ( $ Throwable -> getTrace ( ) ) ; } foreach ( $ trace as $ trace_item ) { if ( strpos ( $ trace_item [ 'function' ] , '{closure}' ) !== false ) { $ trace_item [ 'function' ] = '{closure}' ; } ?>

				<ul class="TraceItem">
					<li class="Function">
						<span class="Function"><?= ( isset ( $ trace_item [ 'class' ] ) ? self :: getShortName ( $ trace_item [ 'class' ] ) : '' ) . ( isset ( $ trace_item [ 'type' ] ) ? $ trace_item [ 'type' ] : '' ) . ( isset ( $ trace_item [ 'function' ] ) ? $ trace_item [ 'function' ] : '' ) ?></span>
						<table class="Elem">
							<tr>
								<td>FQN:</td>
								<td><?= ( isset ( $ trace_item [ 'class' ] ) ? $ trace_item [ 'class' ] : '' ) . ( isset ( $ trace_item [ 'type' ] ) ? $ trace_item [ 'type' ] : '' ) . ( isset ( $ trace_item [ 'function' ] ) ? $ trace_item [ 'function' ] : '' ) ?>()
								</td>
							</tr>
							<tr>
								<td>File:</td>
								<td><?= ( isset ( $ trace_item [ 'file' ] ) ? basename ( $ trace_item [ 'file' ] ) : '' ) ?></td>
							</tr>
							<tr>
								<td>Line:</td>
								<td><?= ( isset ( $ trace_item [ 'line' ] ) ? $ trace_item [ 'line' ] : '' ) ?></td>
							</tr>
							<tr>
								<td>Directory:</td>
								<td><?= ( isset ( $ trace_item [ 'file' ] ) ? dirname ( $ trace_item [ 'file' ] ) : '' ) ?></td>
							</tr>
						</table>
					</li>

					<?php foreach ( ( array ) $ trace_item [ 'args' ] as $ arg ) { $ arg_boolean = false ; $ arg_black = '' ; $ arg_red = '' ; // String if ( is_string ( $ arg ) ) { $ arg_black = '[' . strlen ( $ arg ) . ']' ; $ arg_red = gettype ( $ arg ) ; } // Array elseif ( is_array ( $ arg ) ) { if ( count ( $ arg ) > 0 ) { $ arg_black = '[' . count ( $ arg ) . ']' ; $ arg_red = gettype ( $ arg ) ; } else { $ arg_black = 'array[0]' ; } } // Boolean elseif ( is_bool ( $ arg ) ) { $ arg_boolean = true ; $ arg_black = ( $ arg ? 'true' : 'false' ) ; } // NULL elseif ( is_null ( $ arg ) ) { $ arg_boolean = true ; $ arg_black = 'null' ; } // Number elseif ( is_int ( $ arg ) || is_float ( $ arg ) ) { $ arg_black = $ arg ; } // Object elseif ( is_object ( $ arg ) ) { $ arg_black = '' ; // Treat "silent" classes as a scalar value if ( $ arg instanceof Silenced ) { $ arg_black = BaseException :: getShortName ( get_class ( $ arg ) ) ; } if ( $ arg_black == '' ) { $ arg_red = BaseException :: getShortName ( get_class ( $ arg ) ) ; } } // Other else { $ arg_red = gettype ( $ arg ) ; } ?>

						<li class="Arg">

								<span class="<?= ( $ muted ? '' : 'Arg' ) ?>">
									<?= $ arg_red ?>
								</span><?php if ( $ arg_boolean ) { ?>

								<span class="Boolean"><?= $ arg_black ?></span>

								<?php } else { echo $ arg_black ; } // Argument Details if ( $ arg_red && ! $ muted ) { ?>

								<code class="Elem"><?= htmlspecialchars ( print_r ( $ arg , true ) , ENT_COMPAT | ENT_HTML401 , DEFAULT_CHARSET ) ; ?></code>

								<?php } ?>

						</li>

						<?php } ?>

				</ul>
				<br class="Hidden">

				<?php } } ?>

		<h2>Environment</h2>

		<table class="ErrorMessage">
			<tr>
				<td>PHP:</td>
				<td><?= PHP_VERSION ?> (<?= PHP_SAPI ?>)</td>
			</tr>
			<?php if ( isset ( $ _SERVER [ 'SERVER_SOFTWARE' ] ) ) { ?>

				<tr>
					<td>Server:</td>
					<td><?= $ _SERVER [ 'SERVER_SOFTWARE' ] ?></td>
				</tr>

				<?php } ?>
			<tr>
				<td>Time:</td>
				<td><?= date ( 'd-m-Y H:i:s' ) ?></td>
			</tr>
		</table>

		</body>
		</html>

		<?php return ob_get_clean ( ) ; }
Display an HTML page with information about the Exception.

@param \Throwable $Throwable

@return string
Display an HTML page with information about the Exception .