3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $a; public function test() { try { echo 'doo stuff'; $this->a = 1; return 1; } catch (Exception $e) { $this->a = 2; throw $e; } finally { $this->a = 3; } } } $foo = new Foo(); $foo->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G6JKd
function name:  (null)
number of ops:  6
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class Foo:
Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 162) Position 1 = 12, Position 2 = 4
Branch analysis from position: 12
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) 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
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/G6JKd
function name:  test
number of ops:  16
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     'doo+stuff'
    8     1        ASSIGN_OBJ                                               'a'
          2        OP_DATA                                                  1
    9     3      > FAST_CALL                                                ->12
          4    > > RETURN                                                   1
          5*       JMP                                                      ->10
   10     6  E > > CATCH                                       last         'Exception'
   11     7    >   ASSIGN_OBJ                                               'a'
          8        OP_DATA                                                  2
   12     9      > THROW                                         0          !0
   13    10*       FAST_CALL                                                ->12
         11*       JMP                                                      ->15
   14    12    >   ASSIGN_OBJ                                               'a'
         13        OP_DATA                                                  3
         14      > FAST_RET                                                 
   16    15*     > RETURN                                                   null

End of function test

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.11 ms | 1394 KiB | 13 Q