Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
Latest commit
42 lines (33 loc) · 878 Bytes
/
Copy pathexample.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 = newCodin\Fault\ErrorHandler();
if ('cli' === php_sapi_name()) {
$error->attach(newCodin\Fault\Handlers\Console());
} else {
//$error->attach(new Codin\Fault\Handlers\JsonDump());
//$error->attach(new Codin\Fault\Handlers\PrintDump());
$error->attach(newCodin\Fault\Handlers\WebView($debug = true));
}
$error->register();
functiontriggerUserError(): void
{
$a = [];
$b = 0;
echo$a[$b];
}
functiontriggerUserException(): void
{
try {
thrownewRuntimeException('User exception triggered');
} catch (Throwable$e) {
thrownewOverflowException('Another user exception triggered', 0, $e);
}
}
functiontests(): void
{
triggerUserException();
}
tests();