3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Lazy{ private $data = array(); // value of key 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->c = 'third value'; echo $lazy->c;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s9BNI
function name:  (null)
number of ops:  10
compiled vars:  !0 = $lazy
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'Lazy'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        ASSIGN_OBJ                                               !0, 'a'
          4        OP_DATA                                                  'first+value'
   24     5        ASSIGN_OBJ                                               !0, 'c'
          6        OP_DATA                                                  'third+value'
   25     7        FETCH_OBJ_R                                      ~6      !0, 'c'
          8        ECHO                                                     ~6
          9      > RETURN                                                   1

Class Lazy:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s9BNI
function name:  __set
number of ops:  6
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        FETCH_OBJ_W                                      $2      'data'
          3        ASSIGN_DIM                                               $2, !0
          4        OP_DATA                                                  !1
   11     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/s9BNI
function name:  __get
number of ops:  8
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   15     1        FETCH_OBJ_R                                      ~1      'data'
          2        ARRAY_KEY_EXISTS                                         !0, ~1
          3      > JMPZ                                                     ~2, ->7
   16     4    >   FETCH_OBJ_R                                      ~3      'data'
          5        FETCH_DIM_R                                      ~4      ~3, !0
          6      > RETURN                                                   ~4
   18     7    > > RETURN                                                   null

End of function __get

End of class Lazy.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.18 ms | 1395 KiB | 13 Q