3v4l.org

run code in 300+ 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 = $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/b1Mj7
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/b1Mj7
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/b1Mj7
function name:  modify
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   FETCH_OBJ_R                                      ~1      'prop'
          1        CONCAT                                           ~2      ~1, 'xxx'
          2        ASSIGN_OBJ                                               'prop'
          3        OP_DATA                                                  ~2
   24     4      > RETURN                                                   null

End of function modify

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.96 ms | 1388 KiB | 15 Q