3v4l.org

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

Class a: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.68 ms | 1394 KiB | 15 Q