3v4l.org

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

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

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.74 ms | 1454 KiB | 15 Q