3v4l.org

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

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dcLnH
function name:  foo
number of ops:  4
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               !0, 'some_weird_variable'
          2        OP_DATA                                                  'some+value'
   10     3      > RETURN                                                   null

End of function foo

Class Test:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dcLnH
function name:  __set
number of ops:  5
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ASSIGN_OBJ                                               !0
          3        OP_DATA                                                  !1
    5     4      > RETURN                                                   null

End of function __set

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.73 ms | 1398 KiB | 16 Q