3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { throw new \Exception('Oups.'); } function bar() { return 'Yay'; } function test() { try { $foo = bar(); } catch (\Exception $e) { throw new \Exception('Another one'); } finally { if ($foo === null) { throw new \Exception('Third.'); } return $foo; } } var_dump(test());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/77o9F
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     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 foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/77o9F
function name:  foo
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $0      'Exception'
          1        SEND_VAL_EX                                              'Oups.'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
    5     4*     > RETURN                                                   null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/77o9F
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   'Yay'
    9     1*     > RETURN                                                   null

End of function bar

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 162) Position 1 = 11, Position 2 = 10
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 17
Branch analysis from position: 13
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
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 = 108) Position 1 = -2
filename:       /in/77o9F
function name:  test
number of ops:  21
compiled vars:  !0 = $foo, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'bar'
          1        DO_FCALL                                      0  $3      
          2        ASSIGN                                                   !0, $3
          3      > JMP                                                      ->9
   14     4  E > > CATCH                                       last         'Exception'
   15     5    >   NEW                                              $5      'Exception'
          6        SEND_VAL_EX                                              'Another+one'
          7        DO_FCALL                                      0          
          8      > THROW                                         0          $5
   16     9    > > FAST_CALL                                                ->11
         10    > > JMP                                                      ->20
   17    11    >   TYPE_CHECK                                    2          !0
         12      > JMPZ                                                     ~7, ->17
   18    13    >   NEW                                              $8      'Exception'
         14        SEND_VAL_EX                                              'Third.'
         15        DO_FCALL                                      0          
         16      > THROW                                         0          $8
   20    17    >   DISCARD_EXCEPTION                                        
         18      > RETURN                                                   !0
         19*       FAST_RET                                                 
   22    20    > > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.37 ms | 1403 KiB | 17 Q