3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public $headers = [5]; public function test() { try { return 1; } finally { $this->headers = []; } } } var_dump($foo->headers); $foo = new foo(); var_dump($foo->test()); var_dump($foo->headers);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gkSPU
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_OBJ_R                                      ~1      !0, 'headers'
          2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
   15     4        NEW                                              $3      'foo'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
   16     7        INIT_FCALL                                               'var_dump'
          8        INIT_METHOD_CALL                                         !0, 'test'
          9        DO_FCALL                                      0  $6      
         10        SEND_VAR                                                 $6
         11        DO_ICALL                                                 
   17    12        INIT_FCALL                                               'var_dump'
         13        FETCH_OBJ_R                                      ~8      !0, 'headers'
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class foo:
Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 162) Position 1 = 4, Position 2 = 1
Branch analysis from position: 4
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 1
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gkSPU
function name:  test
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > FAST_CALL                                                ->4
          1    > > RETURN                                                   1
    8     2*       FAST_CALL                                                ->4
          3*       JMP                                                      ->7
    9     4    >   ASSIGN_OBJ                                               'headers'
          5        OP_DATA                                                  <array>
          6      > FAST_RET                                                 
   11     7*     > RETURN                                                   null

End of function test

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
210.07 ms | 1395 KiB | 15 Q