-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror_handler.php
More file actions
74 lines (51 loc) · 1.68 KB
/
Copy patherror_handler.php
File metadata and controls
74 lines (51 loc) · 1.68 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
function errorHandler($errno, $errstr){
echo '<pre>';
echo "[<" . __LINE__ . ">]<b>Error:</b> [$errno] $errstr<br>";
}
set_error_handler('errorHandler', E_USER_WARNING);
$param = 1;
if ($param > 0) {
trigger_error("Value must be zero", E_USER_WARNING);
}
//----------------------------------------------------------
function errorHandlerInternalError($errno, $errstr){
echo '<pre>';
echo "[<" . __LINE__ . ">]<b>Error:</b> [$errno] $errstr<br>";
}
set_error_handler('errorHandlerInternalError', E_ERROR);
$param = 1;
if ($param > 0) {
trigger_error("Value must be zero", E_ERROR);
}
//----------------------------------------------------------
function errorHandlerInternalWarning($errno, $errstr){
echo '<pre>';
echo "[<" . __LINE__ . ">]<b> -- Error -- :</b> [ error number: $errno ] $errstr<br>";
}
set_error_handler('errorHandlerInternalWarning', E_WARNING);
$param = 1;
if ($param > 0) {
trigger_error("Value must be zero", E_WARNING);
}
//----------------------------------------------------------
function errorHandlerInternalParse($errno, $errstr){
echo '<pre>';
echo "[<" . __LINE__ . ">]<b>Error:</b> [$errno] $errstr<br>";
}
set_error_handler('errorHandlerInternalParse', E_PARSE);
$param = 1;
if ($param > 0) {
trigger_error("Value must be zero", E_PARSE);
}
//----------------------------------------------------------
function errorHandlerAll($errno, $errstr){
echo '<pre>';
echo "[<" . __LINE__ . ">]<b>Error:</b> [$errno] $errstr<br>";
}
set_error_handler('errorHandlerAll', E_ALL);
function shutdownHandler() {
var_dump('I AM HERE');
}
register_shutdown_function('shutdownHandler');
require 'not_existing.php';