3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { private $var; public function buggy() { $bar = new Bar; $bar->prop = & $this->var; $bar->modify(); var_dump($this->var); } } class Bar { public $prop; public function modify() { $this->prop .= 'xxx'; } } $o = new Foo; $o->buggy();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Lc1QW
function name:  (null)
number of ops:  6
compiled vars:  !0 = $o
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   27     0  E >   NEW                                                  $1      'Foo'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   28     3        INIT_METHOD_CALL                                             !0, 'buggy'
          4        DO_FCALL                                          0          
          5      > RETURN                                                       1

Class Foo:
Function buggy:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Lc1QW
function name:  buggy
number of ops:  14
compiled vars:  !0 = $bar
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   NEW                                                  $1      'Bar'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   10     3        FETCH_OBJ_W                                          $5      'var'
          4        MAKE_REF                                             $6      $5
          5        ASSIGN_OBJ_REF                                               !0, 'prop'
          6        OP_DATA                                                      $6
   11     7        INIT_METHOD_CALL                                             !0, 'modify'
          8        DO_FCALL                                          0          
   13     9        INIT_FCALL                                                   'var_dump'
         10        FETCH_OBJ_R                                          ~8      'var'
         11        SEND_VAL                                                     ~8
         12        DO_ICALL                                                     
   14    13      > RETURN                                                       null

End of function buggy

End of class Foo.

Class Bar:
Function modify:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Lc1QW
function name:  modify
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   23     0  E >   ASSIGN_OBJ_OP                                     8          'prop'
          1        OP_DATA                                                      'xxx'
   24     2      > RETURN                                                       null

End of function modify

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
232.14 ms | 2790 KiB | 14 Q