php-src/sapi/phpdbg/tests/exceptions_003.phpt
Dmitry Stogov 2ae21abdf7 Fixed bug #72213 (Finally leaks on nested exceptions).
Squashed commit of the following:

commit 8461b0407f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed May 25 00:34:42 2016 +0300

    Rmoved zend_try_catch_element.parent and walk through op_array.try_catch_array backward from the current try_cacth_offset.

commit 0c71e24964
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed May 25 00:04:53 2016 +0300

    Move SAVE_OPLINE() to its original place

commit 111432a4df
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed May 25 00:01:10 2016 +0300

    Separate the common part of ZEND_HANDLE_EXCEPTION and FAST_RET into zend_dispatch_try_catch_finally_helper.

commit 4f21c06c2e
Author: Nikita Popov <nikic@php.net>
Date:   Tue May 24 14:55:27 2016 +0200

    Improve finally fix

commit da5c727499
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue May 24 10:36:08 2016 +0300

    Fixed Zend/tests/try/bug70228_3.phpt and Zend/tests/try/bug70228_4.phpt

commit cfcedf2fb4
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue May 24 02:59:27 2016 +0300

    Added test

commit 4c6aa93d43
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue May 24 00:38:20 2016 +0300

    Added tests

commit 8a8f4704b0
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon May 23 23:27:34 2016 +0300

    Fixed bug #72213 (Finally leaks on nested exceptions)
2016-05-25 01:25:12 +03:00

55 lines
1.2 KiB
PHP

--TEST--
Test breaks on HANDLE_EXCEPTION
--PHPDBG--
b 5
r
s
s
q
--EXPECTF--
[Successful compilation of %s]
prompt> [Breakpoint #0 added at %s:5]
prompt> [Breakpoint #0 at %s:5, hits: 1]
>00005: x();
00006: } finally {
00007: print "ok\n";
prompt> [L0 %s HANDLE_EXCEPTION %s]
>00005: x();
00006: } finally {
00007: print "ok\n";
prompt> [L7 %s ECHO "ok " %s]
>00007: print "ok\n";
00008: }
00009: } catch (Error $e) {
prompt> ok
[L7 %s FAST_RET ~%d try-catch(0) %s]
[L9 %s CATCH "Error" $e 1 %s]
>00005: x();
00006: } finally {
00007: print "ok\n";
prompt> [L10 %s ECHO "caught " %s]
>00010: print "caught\n";
00011: }
00012:
prompt> caught
[L10 %s RETURN 1 %s]
[Script ended normally]
prompt>
--FILE--
<?php
try {
try {
x();
} finally {
print "ok\n";
}
} catch (Error $e) {
print "caught\n";
}
?>