3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { try { throw new Exception("ex1"); } finally { bar(); } } function bar() { try { throw new Exception("ex2"); } catch (Exception $e) { echo "caught exception in finally block: $e ....\n"; } echo "end of finally.\n"; } try { foo(); echo "this should not get executed.\n"; } catch (Exception $e) { echo "caught exception from foo() call: $e ....\n"; } echo "all done.\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 4
Branch analysis from position: 4
2 jumps found. (Code = 107) Position 1 = 5, Position 2 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AkF06
function name:  (null)
number of ops:  11
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'foo'
          1        DO_FCALL                                      0          
   22     2        ECHO                                                     'this+should+not+get+executed.%0A'
          3      > JMP                                                      ->9
   23     4  E > > CATCH                                       last         'Exception'
   24     5    >   ROPE_INIT                                     3  ~3      'caught+exception+from+foo%28%29+call%3A+'
          6        ROPE_ADD                                      1  ~3      ~3, !0
          7        ROPE_END                                      2  ~2      ~3, '+....%0A'
          8        ECHO                                                     ~2
   26     9    >   ECHO                                                     'all+done.%0A'
         10      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/AkF06
function name:  foo
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $1      'Exception'
          1        SEND_VAL_EX                                              'ex1'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $1
    6     4*       FAST_CALL                                                ->6
          5*       JMP                                                      ->9
    7     6*       INIT_FCALL_BY_NAME                                       'bar'
          7*       DO_FCALL                                      0          
          8*       FAST_RET                                                 
    9     9*     > RETURN                                                   null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AkF06
function name:  bar
number of ops:  12
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'Exception'
          1        SEND_VAL_EX                                              'ex2'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $1
          4*       JMP                                                      ->10
   14     5  E > > CATCH                                       last         'Exception'
   15     6    >   ROPE_INIT                                     3  ~4      'caught+exception+in+finally+block%3A+'
          7        ROPE_ADD                                      1  ~4      ~4, !0
          8        ROPE_END                                      2  ~3      ~4, '+....%0A'
          9        ECHO                                                     ~3
   17    10        ECHO                                                     'end+of+finally.%0A'
   18    11      > RETURN                                                   null

End of function bar

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.44 ms | 1403 KiB | 14 Q