3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $publicProperty = array(); } class Bar { public function __construct(Foo $foo) { $this->wrapped = $foo; } public function __get($name) { return $this->wrapped->$name; } } $bar = new Bar(new Foo()); $bar->publicProperty['example'] = 'Hello World!'; var_dump($bar->publicProperty);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g95jQ
function name:  (null)
number of ops:  14
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'Bar'
          1        NEW                                              $2      'Foo'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $2
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   23     6        FETCH_OBJ_W                                      $6      !0, 'publicProperty'
          7        ASSIGN_DIM                                               $6, 'example'
          8        OP_DATA                                                  'Hello+World%21'
   25     9        INIT_FCALL                                               'var_dump'
         10        FETCH_OBJ_R                                      ~8      !0, 'publicProperty'
         11        SEND_VAL                                                 ~8
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class Foo: [no user functions]
Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g95jQ
function name:  __construct
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        ASSIGN_OBJ                                               'wrapped'
          2        OP_DATA                                                  !0
   13     3      > RETURN                                                   null

End of function __construct

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g95jQ
function name:  __get
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        FETCH_OBJ_R                                      ~1      'wrapped'
          2        FETCH_OBJ_R                                      ~2      ~1, !0
          3      > RETURN                                                   ~2
   18     4*     > RETURN                                                   null

End of function __get

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.99 ms | 1388 KiB | 15 Q