3v4l.org

run code in 500+ PHP versions simultaneously
<?php function initialize_properties_here(array $properties) { $properties['bar'] = 123; } class Foo { private int $bar = 123; public function __get(string $name) { $props = ['bar' => & $this->bar]; initialize_properties_here($props); return $this->$name; } } var_dump((new Foo())->bar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sKqYb
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                                   'var_dump'
          1        NEW                                                  $0      'Foo'
          2        DO_FCALL                                          0          
          3        FETCH_OBJ_R                                          ~2      $0, 'bar'
          4        SEND_VAL                                                     ~2
          5        DO_ICALL                                                     
          6      > RETURN                                                       1

Function initialize_properties_here:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sKqYb
function name:  initialize_properties_here
number of ops:  4
compiled vars:  !0 = $properties
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        ASSIGN_DIM                                                   !0, 'bar'
          2        OP_DATA                                                      123
    5     3      > RETURN                                                       null

End of function initialize_properties_here

Class Foo:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sKqYb
function name:  __get
number of ops:  10
compiled vars:  !0 = $name, !1 = $props
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
   12     1        FETCH_OBJ_W                                          $2      'bar'
          2        INIT_ARRAY                                           ~3      $2, 'bar'
          3        ASSIGN                                                       !1, ~3
   13     4        INIT_FCALL                                                   'initialize_properties_here'
          5        SEND_VAR                                                     !1
          6        DO_FCALL                                          0          
   15     7        FETCH_OBJ_R                                          ~6      !0
          8      > RETURN                                                       ~6
   16     9*     > RETURN                                                       null

End of function __get

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.83 ms | 2228 KiB | 15 Q