3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Magic { protected $v = ['a'=>1, 'b'=>2, 'c'=>3]; public function &__get($v){ return $this->v[$v]; } } $m = new Magic(); $m->d[] = 45; echo $m->d[0]; #echo $m->a;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LLhpb
function name:  (null)
number of ops:  10
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'Magic'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   12     3        FETCH_OBJ_W                                      $4      !0, 'd'
          4        ASSIGN_DIM                                               $4
          5        OP_DATA                                                  45
   13     6        FETCH_OBJ_R                                      ~6      !0, 'd'
          7        FETCH_DIM_R                                      ~7      ~6, 0
          8        ECHO                                                     ~7
   14     9      > RETURN                                                   1

Class Magic:
Function __get:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/LLhpb
function name:  __get
number of ops:  5
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        FETCH_OBJ_W                                      $1      'v'
          2        FETCH_DIM_W                                      $2      $1, !0
          3      > RETURN_BY_REF                                            $2
    7     4*     > RETURN_BY_REF                                            null

End of function __get

End of class Magic.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.29 ms | 1397 KiB | 13 Q