3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar{ public $prop = 2; } $foo = array( 'foo' => '', 'bar' => new Bar(), ); $bar = $foo; $barbar = $bar['bar']; $barbar->prop = 3; var_dump($foo, $bar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JTcpa
function name:  (null)
number of ops:  15
compiled vars:  !0 = $foo, !1 = $bar, !2 = $barbar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_ARRAY                                       ~3      '', 'foo'
    9     1        NEW                                              $4      'Bar'
          2        DO_FCALL                                      0          
          3        ADD_ARRAY_ELEMENT                                ~3      $4, 'bar'
    7     4        ASSIGN                                                   !0, ~3
   12     5        ASSIGN                                                   !1, !0
   13     6        FETCH_DIM_R                                      ~8      !1, 'bar'
          7        ASSIGN                                                   !2, ~8
   14     8        ASSIGN_OBJ                                               !2, 'prop'
          9        OP_DATA                                                  3
   17    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class Bar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.73 ms | 1394 KiB | 15 Q