3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar{ public $prop = 2; } $foo = array( 'foo' => '', 'bar' => new Bar(), ); $bar = clone $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/cvNHe
function name:  (null)
number of ops:  16
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        CLONE                                            ~7      !0
          6        ASSIGN                                                   !1, ~7
   13     7        FETCH_DIM_R                                      ~9      !1, 'bar'
          8        ASSIGN                                                   !2, ~9
   14     9        ASSIGN_OBJ                                               !2, 'prop'
         10        OP_DATA                                                  3
   17    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Class Bar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.88 ms | 1394 KiB | 15 Q