3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $var = new StdClass(); $var->foo = 'bar'; $GLOBALS['this'] = $var; var_dump($this); $var->foo = 'baz'; $foo = 'this'; $$foo = $var; var_dump($this); foo($this); function foo($this){ $GLOBALS['this']->foo = 'baw'; var_dump($this); }
based on 6d6ao
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/Fq7jp
function name:  (null)
number of ops:  24
compiled vars:  !0 = $var, !1 = $this, !2 = $foo
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NEW                                              $3      :-6
         1        DO_FCALL                                      0          
         2        ASSIGN                                                   !0, $3
   4     3        ASSIGN_OBJ                                               !0, 'foo'
         4        OP_DATA                                                  'bar'
   6     5        FETCH_W                      global              $7      'GLOBALS'
         6        ASSIGN_DIM                                               $7, 'this'
         7        OP_DATA                                                  !0
   8     8        INIT_FCALL                                               'var_dump'
         9        SEND_VAR                                                 !1
        10        DO_ICALL                                                 
  10    11        ASSIGN_OBJ                                               !0, 'foo'
        12        OP_DATA                                                  'baz'
  12    13        ASSIGN                                                   !2, 'this'
  13    14        FETCH_W                      local               $12     !2
        15        ASSIGN                                                   $12, !0
  15    16        INIT_FCALL                                               'var_dump'
        17        SEND_VAR                                                 !1
        18        DO_ICALL                                                 
  17    19        INIT_FCALL_BY_NAME                                       'foo'
        20        SEND_VAR_EX                                              !1
        21        DO_FCALL                                      0          
  19    22        NOP                                                      
  22    23      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/Fq7jp
function name:  foo
number of ops:  9
compiled vars:  !0 = $this
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  19     0  E >   RECV                                             !0      
  20     1        FETCH_W                      global              $1      'GLOBALS'
         2        FETCH_DIM_W                                      $2      $1, 'this'
         3        ASSIGN_OBJ                                               $2, 'foo'
         4        OP_DATA                                                  'baw'
  21     5        INIT_FCALL                                               'var_dump'
         6        SEND_VAR                                                 !0
         7        DO_ICALL                                                 
  22     8      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 7.3.0