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/VtE3Q
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
2 jumps found. (Code = 162) Position 1 = 12, Position 2 = 3
Branch analysis from position: 12
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 3
1 jumps found. (Code = 62) 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
2 jumps found. (Code = 162) Position 1 = 12, Position 2 = 9
Branch analysis from position: 12
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VtE3Q
function name:  test
number of ops:  14
compiled vars:  !0 = $a, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 1
    8     1        QM_ASSIGN                                        ~4      !0
          2      > FAST_CALL                                                ->12
          3    > > RETURN                                                   ~4
          4*       JMP                                                      ->10
    9     5  E > > CATCH                                       last         'Exception'
   10     6    >   ASSIGN                                                   !0, 2
   11     7        QM_ASSIGN                                        ~6      !0
          8      > FAST_CALL                                                ->12
          9    > > RETURN                                                   ~6
   12    10*       FAST_CALL                                                ->12
         11*       JMP                                                      ->13
         12    > > FAST_RET                                                 
   15    13*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.76 ms | 1453 KiB | 15 Q