3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x { public $d = ['test' => null]; public function __set($k,$v) { var_dump(['set', $k, $v]); $this->d[$k] = $v; } public function __get($k) { var_dump(['get', $k]); return $this->d[$k]; } } $x = new x; $x->test++; var_dump($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EnI1l
function name:  (null)
number of ops:  8
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'x'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        PRE_INC_OBJ                                              !0, 'test'
   18     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Class x:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EnI1l
function name:  __set
number of ops:  12
compiled vars:  !0 = $k, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        INIT_FCALL                                               'var_dump'
          3        INIT_ARRAY                                       ~2      'set'
          4        ADD_ARRAY_ELEMENT                                ~2      !0
          5        ADD_ARRAY_ELEMENT                                ~2      !1
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
    7     8        FETCH_OBJ_W                                      $4      'd'
          9        ASSIGN_DIM                                               $4, !0
         10        OP_DATA                                                  !1
    8    11      > RETURN                                                   null

End of function __set

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EnI1l
function name:  __get
number of ops:  10
compiled vars:  !0 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        INIT_FCALL                                               'var_dump'
          2        INIT_ARRAY                                       ~1      'get'
          3        ADD_ARRAY_ELEMENT                                ~1      !0
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                                 
   11     6        FETCH_OBJ_R                                      ~3      'd'
          7        FETCH_DIM_R                                      ~4      ~3, !0
          8      > RETURN                                                   ~4
   12     9*     > RETURN                                                   null

End of function __get

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.28 ms | 1396 KiB | 15 Q