3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { private $prop = array(); public function &__get($name){ if(!array_key_exists($name, $this->prop)){ $this->prop[$name] = null; } return $this->prop[$name]; } public function __set($name, $val){ $this->prop[$name] = $val; } } $test = new test(); $test->a[] = 5; var_dump($test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sdIWH
function name:  (null)
number of ops:  10
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        FETCH_OBJ_W                                      $4      !0, 'a'
          4        ASSIGN_DIM                                               $4
          5        OP_DATA                                                  5
   20     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class test:
Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
Return found
Branch analysis from position: 8
filename:       /in/sdIWH
function name:  __get
number of ops:  12
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        FETCH_OBJ_R                                      ~1      'prop'
          2        ARRAY_KEY_EXISTS                                 ~2      !0, ~1
          3        BOOL_NOT                                         ~3      ~2
          4      > JMPZ                                                     ~3, ->8
    8     5    >   FETCH_OBJ_W                                      $4      'prop'
          6        ASSIGN_DIM                                               $4, !0
          7        OP_DATA                                                  null
   10     8    >   FETCH_OBJ_W                                      $6      'prop'
          9        FETCH_DIM_W                                      $7      $6, !0
         10      > RETURN_BY_REF                                            $7
   11    11*     > 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/sdIWH
function name:  __set
number of ops:  6
compiled vars:  !0 = $name, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        FETCH_OBJ_W                                      $2      'prop'
          3        ASSIGN_DIM                                               $2, !0
          4        OP_DATA                                                  !1
   15     5      > RETURN                                                   null

End of function __set

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.79 ms | 1411 KiB | 15 Q