forked from krakjoe/pthreads
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexception-handler-caught-nested.phpt
74 lines (71 loc) · 1.38 KB
/
exception-handler-caught-nested.phpt
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
--TEST--
Test exception handler (nested caught) bug #498
--DESCRIPTION--
More mishandling of exceptions, regression test
--FILE--
<?php
class Test extends Thread {
public function run() {
set_exception_handler(function($message) {
var_dump('Uncaught', $message);
});
try {
self::processClassMethods();
} catch(\Throwable $e) {
var_dump('Caught', $e);
}
}
public static function processClassMethods() {
throw new \Exception();
}
}
$test = new Test();
$test->start();
$test->join();
--EXPECTF--
string(6) "Caught"
object(Exception)#3 (7) {
["message":protected]=>
string(0) ""
["string":"Exception":private]=>
string(0) ""
["code":protected]=>
int(0)
["file":protected]=>
string(%d) "%s"
["line":protected]=>
int(16)
["trace":"Exception":private]=>
array(2) {
[0]=>
array(6) {
["file"]=>
string(%d) "%s"
["line"]=>
int(9)
["function"]=>
string(19) "processClassMethods"
["class"]=>
string(4) "Test"
["type"]=>
string(2) "::"
["args"]=>
array(0) {
}
}
[1]=>
array(4) {
["function"]=>
string(3) "run"
["class"]=>
string(4) "Test"
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
}
["previous":"Exception":private]=>
NULL
}