3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $info = []; function __set($k, $v){ $this->info[$k] = $v; } function __get($k){ return $this->info[$k] ?: null; } } $bar = new Foo(); $bar->foo = []; var_dump($bar->foo); $bar->foo[] = 'fool'; var_dump($bar->foo); $bar->foo = array(); var_dump($bar->foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/krkOV
function name:  (null)
number of ops:  23
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        ASSIGN_OBJ                                               !0, 'foo'
          4        OP_DATA                                                  <array>
   16     5        INIT_FCALL                                               'var_dump'
          6        FETCH_OBJ_R                                      ~5      !0, 'foo'
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                                 
   17     9        FETCH_OBJ_W                                      $7      !0, 'foo'
         10        ASSIGN_DIM                                               $7
         11        OP_DATA                                                  'fool'
   18    12        INIT_FCALL                                               'var_dump'
         13        FETCH_OBJ_R                                      ~9      !0, 'foo'
         14        SEND_VAL                                                 ~9
         15        DO_ICALL                                                 
   19    16        ASSIGN_OBJ                                               !0, 'foo'
         17        OP_DATA                                                  <array>
   20    18        INIT_FCALL                                               'var_dump'
         19        FETCH_OBJ_R                                      ~12     !0, 'foo'
         20        SEND_VAL                                                 ~12
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

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

End of function __set

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/krkOV
function name:  __get
number of ops:  7
compiled vars:  !0 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        FETCH_OBJ_R                                      ~1      'info'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3        JMP_SET                                          ~3      ~2, ->5
          4        QM_ASSIGN                                        ~3      null
          5      > RETURN                                                   ~3
   11     6*     > RETURN                                                   null

End of function __get

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.22 ms | 1400 KiB | 15 Q