3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { protected $data = array('some' => array('sub' => 'data')); public function __set($name, $value) { $this->data[$name] = $value; } public function __get($name) { if (is_scalar($this->data[$name])) { $property = $this->data[$name]; } else { $property = &$this->data[$name]; } return $property; } } $my = new MyClass(); $my->some['sub'] = 'test'; // пытаемся изменить значение echo $my->some['sub']; // выведет 'data'
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XoLsB
function name:  (null)
number of ops:  10
compiled vars:  !0 = $my
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'MyClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        FETCH_OBJ_W                                      $4      !0, 'some'
          4        ASSIGN_DIM                                               $4, 'sub'
          5        OP_DATA                                                  'test'
   26     6        FETCH_OBJ_R                                      ~6      !0, 'some'
          7        FETCH_DIM_R                                      ~7      ~6, 'sub'
          8        ECHO                                                     ~7
          9      > RETURN                                                   1

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

End of function __set

Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XoLsB
function name:  __get
number of ops:  14
compiled vars:  !0 = $name, !1 = $property
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        FETCH_OBJ_R                                      ~2      'data'
          2        FETCH_DIM_R                                      ~3      ~2, !0
          3        TYPE_CHECK                                  124          ~3
          4      > JMPZ                                                     ~4, ->9
   11     5    >   FETCH_OBJ_R                                      ~5      'data'
          6        FETCH_DIM_R                                      ~6      ~5, !0
          7        ASSIGN                                                   !1, ~6
          8      > JMP                                                      ->12
   15     9    >   FETCH_OBJ_W                                      $8      'data'
         10        FETCH_DIM_W                                      $9      $8, !0
         11        ASSIGN_REF                                               !1, $9
   18    12    > > RETURN                                                   !1
   19    13*     > RETURN                                                   null

End of function __get

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.95 ms | 1399 KiB | 13 Q