Skip to content

Commit dde552f

Browse files
committed
Add Tests for #65784 in 5.5
1 parent 54213b4 commit dde552f

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

Zend/tests/bug65784.phpt

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
--TEST--
2+
Fixed Bug #65784 (Segfault with finally)
3+
--XFAIL--
4+
This bug is not fixed in 5.5 due to ABI BC
5+
--FILE--
6+
<?php
7+
function foo1() {
8+
try {
9+
throw new Exception("not catch");
10+
return true;
11+
} finally {
12+
try {
13+
throw new Exception("catched");
14+
} catch (Exception $e) {
15+
}
16+
}
17+
}
18+
try {
19+
$foo = foo1();
20+
var_dump($foo);
21+
} catch (Exception $e) {
22+
do {
23+
var_dump($e->getMessage());
24+
} while ($e = $e->getPrevious());
25+
}
26+
27+
function foo2() {
28+
try {
29+
try {
30+
throw new Exception("catched");
31+
return true;
32+
} finally {
33+
try {
34+
throw new Exception("catched");
35+
} catch (Exception $e) {
36+
}
37+
}
38+
} catch (Exception $e) {
39+
}
40+
}
41+
42+
$foo = foo2();
43+
var_dump($foo);
44+
45+
function foo3() {
46+
try {
47+
throw new Exception("not catched");
48+
return true;
49+
} finally {
50+
try {
51+
throw new NotExists();
52+
} catch (Exception $e) {
53+
}
54+
}
55+
}
56+
57+
$bar = foo3();
58+
--EXPECTF--
59+
string(9) "not catch"
60+
NULL
61+
62+
Fatal error: Class 'NotExists' not found in %sbug65784.php on line %d

0 commit comments

Comments
 (0)