blob: 00290ee542ef8f089d442cdca180cf7204e88b3c (
plain)
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
|
--TEST--
Bug #38047 ("file" and "line" sometimes not set in backtrace from inside error handler)
--FILE--
<?php
error_reporting(E_ALL);
set_error_handler('kalus_error_handler');
ini_set("display_errors", "on");
class A {
function A_ftk($a) {
}
}
function kalus_error_handler($error_code, $error_string, $filename, $line, $symbols) {
echo "$error_string\n";
get_error_context();
}
function get_error_context() {
$backtrace = debug_backtrace();
$n = 1;
foreach ($backtrace as $call) {
echo $n++." ";
if (isset($call["file"])) {
echo $call["file"];
if (isset($call["line"])) {
echo ":".$call["line"];
}
}
if (isset($call["function"])) {
echo " ".$call["function"]."()";
}
echo "\n";
}
echo "\n";
}
//This will not create file and line items for the call into the error handler
$page["name"] = A::A_ftk();
?>
--EXPECTF--
Non-static method A::A_ftk() should not be called statically
1 %sbug38047.php:13 get_error_context()
2 %sbug38047.php:36 kalus_error_handler()
3 %sbug38047.php:36 A_ftk()
Missing argument 1 for A::A_ftk(), called in %sbug38047.php on line 36 and defined
1 %sbug38047.php:13 get_error_context()
2 %sbug38047.php:7 kalus_error_handler()
3 %sbug38047.php:36 A_ftk()
|