-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
42 lines (33 loc) · 878 Bytes
/
example.php
File metadata and controls
42 lines (33 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
ini_set('memory_limit', 1024 * 1024 * 10);
ini_set('display_errors', 1);
error_reporting(E_ALL);
require __DIR__ . '/vendor/autoload.php';
$error = new Codin\Fault\ErrorHandler();
if ('cli' === php_sapi_name()) {
$error->attach(new Codin\Fault\Handlers\Console());
} else {
//$error->attach(new Codin\Fault\Handlers\JsonDump());
//$error->attach(new Codin\Fault\Handlers\PrintDump());
$error->attach(new Codin\Fault\Handlers\WebView($debug = true));
}
$error->register();
function triggerUserError(): void
{
$a = [];
$b = 0;
echo $a[$b];
}
function triggerUserException(): void
{
try {
throw new RuntimeException('User exception triggered');
} catch (Throwable $e) {
throw new OverflowException('Another user exception triggered', 0, $e);
}
}
function tests(): void
{
triggerUserException();
}
tests();