3v4l.org

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

Class x:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u7oWF
function name:  __set
number of ops:  6
compiled vars:  !0 = $k, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        FETCH_OBJ_W                                      $2      'd'
          3        ASSIGN_DIM                                               $2, !0
          4        OP_DATA                                                  !1
          5      > 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/u7oWF
function name:  __get
number of ops:  5
compiled vars:  !0 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        FETCH_OBJ_R                                      ~1      'd'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of function __get

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.07 ms | 1395 KiB | 15 Q