3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x { public $d = []; public function __set($k,$v) { echo "SET\n"; $this->d[$k] = $v; } public function __get($k) { echo "GET\n"; 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/RE0np
function name:  (null)
number of ops:  8
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $1      'x'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   10     3        PRE_INC_OBJ                                              !0, 'test'
   12     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/RE0np
function name:  __set
number of ops:  7
compiled vars:  !0 = $k, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        ECHO                                                     'SET%0A'
          3        FETCH_OBJ_W                                      $2      'd'
          4        ASSIGN_DIM                                               $2, !0
          5        OP_DATA                                                  !1
          6      > 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/RE0np
function name:  __get
number of ops:  6
compiled vars:  !0 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        ECHO                                                     'GET%0A'
          2        FETCH_OBJ_R                                      ~1      'd'
          3        FETCH_DIM_R                                      ~2      ~1, !0
          4      > RETURN                                                   ~2
          5*     > RETURN                                                   null

End of function __get

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.66 ms | 1395 KiB | 15 Q