3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SetterTester { private $array = array(); public function &__get($name) { echo "__get({$name})\n"; return $this->array(); } public function __set($name, $value) { echo "__set({$name}, {$value})\n"; } } echo "Test array version", PHP_EOL; $test = new SetterTester(); $test->property["index"] = "Some value"; print_r($test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bBVbA
function name:  (null)
number of ops:  12
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     'Test+array+version'
          1        ECHO                                                     '%0A'
   15     2        NEW                                              $1      'SetterTester'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   16     5        FETCH_OBJ_W                                      $4      !0, 'property'
          6        ASSIGN_DIM                                               $4, 'index'
          7        OP_DATA                                                  'Some+value'
   17     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class SetterTester:
Function __get:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/bBVbA
function name:  __get
number of ops:  9
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ROPE_INIT                                     3  ~2      '__get%28'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%29%0A'
          4        ECHO                                                     ~1
    7     5        INIT_METHOD_CALL                                         'array'
          6        DO_FCALL                                      0  $4      
          7      > RETURN_BY_REF                                            $4
    8     8*     > RETURN_BY_REF                                            null

End of function __get

Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bBVbA
function name:  __set
number of ops:  9
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        ROPE_INIT                                     5  ~3      '__set%28'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_ADD                                      2  ~3      ~3, '%2C+'
          5        ROPE_ADD                                      3  ~3      ~3, !1
          6        ROPE_END                                      4  ~2      ~3, '%29%0A'
          7        ECHO                                                     ~2
   11     8      > RETURN                                                   null

End of function __set

End of class SetterTester.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.37 ms | 1400 KiB | 15 Q