3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Lazy{ private $data = array(); // value of each property is public public function __set($key, $value){ $this->data[$key] = $value; } public function __get($key){ if(array_key_exists($key, $this->data)) { return $this->data[$key]; } } } $lazy = new Lazy(); $lazy->a = "first value"; $lazy->b = "second value"; $lazy->c = "third value"; echo $lazy->b; // second value
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TPlEY
function name:  (null)
number of ops:  12
compiled vars:  !0 = $lazy
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Lazy'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        ASSIGN_OBJ                                               !0, 'a'
          4        OP_DATA                                                  'first+value'
   21     5        ASSIGN_OBJ                                               !0, 'b'
          6        OP_DATA                                                  'second+value'
   22     7        ASSIGN_OBJ                                               !0, 'c'
          8        OP_DATA                                                  'third+value'
   23     9        FETCH_OBJ_R                                      ~7      !0, 'b'
         10        ECHO                                                     ~7
         11      > RETURN                                                   1

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

End of function __set

Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TPlEY
function name:  __get
number of ops:  8
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        FETCH_OBJ_R                                      ~1      'data'
          2        ARRAY_KEY_EXISTS                                         !0, ~1
          3      > JMPZ                                                     ~2, ->7
   13     4    >   FETCH_OBJ_R                                      ~3      'data'
          5        FETCH_DIM_R                                      ~4      ~3, !0
          6      > RETURN                                                   ~4
   15     7    > > RETURN                                                   null

End of function __get

End of class Lazy.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.14 ms | 1395 KiB | 13 Q