xref: /PHP-7.2/sapi/phpdbg/tests/stepping_001.phpt (revision d99cd289)
1--TEST--
2Stepping with exceptions must not be stuck at CATCH
3--INI--
4opcache.enable=0
5--PHPDBG--
6b ZEND_THROW
7r
8s
9
10
11
12
13
14
15q
16--EXPECTF--
17[Successful compilation of %s]
18prompt> [Breakpoint #0 added at ZEND_THROW]
19prompt> [Breakpoint #0 in ZEND_THROW at %s:4, hits: 1]
20>00004: 	throw new Exception;
21 00005: }
22 00006:
23prompt> [L0 %s HANDLE_EXCEPTION                                                                       %s]
24>00004: 	throw new Exception;
25 00005: }
26 00006:
27prompt> [L0 %s HANDLE_EXCEPTION                                                                       %s]
28[L9 %s CATCH<-%d>             "Exception"          $e                   1                    %s]
29>00008: 	foo();
30 00009: } catch (Exception $e) {
31 00010: 	echo "ok";
32prompt> [L10 %s ECHO                    "ok"                                                           %s]
33>00010: 	echo "ok";
34 00011: } finally {
35 00012: 	echo " ... ok";
36prompt> ok
37[L11 %s FAST_CALL               J8                                        ~%d                   %s]
38>00011: } finally {
39 00012: 	echo " ... ok";
40 00013: }
41prompt> [L12 %s ECHO                    " ... ok"                                                      %s]
42>00012: 	echo " ... ok";
43 00013: }
44 00014:
45prompt>  ... ok
46[L12 %s FAST_RET                ~%d                                                             %s]
47[L11 %s JMP                     J10                                                            %s]
48>00011: } finally {
49 00012: 	echo " ... ok";
50 00013: }
51prompt> [L14 %s RETURN<-1>              1                                                              %s]
52>00014:
53prompt>
54--FILE--
55<?php
56
57function foo() {
58	throw new Exception;
59}
60
61try {
62	foo();
63} catch (Exception $e) {
64	echo "ok";
65} finally {
66	echo " ... ok";
67}
68