3v4l.org

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

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

End of function __set

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.04 ms | 1396 KiB | 15 Q