3v4l.org

run code in 300+ PHP versions simultaneously
<?php function testThrowFinally(){ $a = 3; try { throw new RuntimeException('bla'); } catch (RuntimeException $e) { return $a; } finally { $a = 5; return $a; } } print testThrowFinally();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PWdtW
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'testthrowfinally'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
          3      > RETURN                                                   1

Function testthrowfinally:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
2 jumps found. (Code = 162) Position 1 = 12, Position 2 = 9
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PWdtW
function name:  testThrowFinally
number of ops:  17
compiled vars:  !0 = $a, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 3
    5     1        NEW                                              $4      'RuntimeException'
          2        SEND_VAL_EX                                              'bla'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $4
          5*       JMP                                                      ->10
    6     6  E > > CATCH                                       last         'RuntimeException'
    7     7    >   QM_ASSIGN                                        ~6      !0
          8      > FAST_CALL                                                ->12
          9    > > RETURN                                                   ~6
    8    10*       FAST_CALL                                                ->12
         11*       JMP                                                      ->16
    9    12    >   ASSIGN                                                   !0, 5
   10    13        DISCARD_EXCEPTION                                        
         14      > RETURN                                                   !0
         15*       FAST_RET                                                 
   12    16*     > RETURN                                                   null

End of function testthrowfinally

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.19 ms | 1398 KiB | 14 Q