forked from brenno-duarte/modern-php-exception
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index-test.php
56 lines (40 loc) · 1.05 KB
/
index-test.php
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
require 'vendor/autoload.php';
use Test\UserTest;
use ModernPHPException\ModernPHPException;
$config = __DIR__ . '/config.example.yaml';
//$config = "";
$exc = new ModernPHPException($config);
#$exc->enableOccurrences();
$exc->ignoreErrors([E_USER_DEPRECATED, E_WARNING]);
$exc->start();
#http_response_code(404);
#echo '<pre>';
//throw new Exception("Error Processing Request");
//error_reporting(E_ALL & ~E_USER_DEPRECATED);
trigger_error("Test", E_USER_DEPRECATED);
echo "After trigger_error";
//UserTest::staticCall();
/* function dividir($x, $y) {
if ($y == 0) {
throw new \Exception('é uma divisão por zero.');
}
$resultado = $x / $y;
return $resultado;
};
try {
echo dividir(5,0)."<br/>";
} catch (\Exception $e) {
$exc->exceptionHandler($e);
//echo $e->getMessage();
} */
/* try {
echo $a;
} catch (\Exception $e) {
$exc->exceptionHandler($e);
} */
/* $a = (new UserTest())->secondCall();
var_dump_debug($a, true); */
echo $a;
//$a = new FakeClass(); //FATAL ERROR
//(new UserTest())->triggerTest();