3v4l.org

run code in 300+ PHP versions simultaneously
<?php $node = new stdClass(); $vals = array('und' => array(0 => array('value' => 'test'))); $node->field_test = &$vals; $clone = clone $node; $clone->field_test['und'] = array(0 => array('value' => 'modified')); print_r($node); print_r($clone);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qAt2t
function name:  (null)
number of ops:  18
compiled vars:  !0 = $node, !1 = $vals, !2 = $clone
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    4     3        ASSIGN                                                   !1, <array>
    5     4        ASSIGN_OBJ_REF                                           !0, 'field_test'
          5        OP_DATA                                                  !1
    6     6        CLONE                                            ~8      !0
          7        ASSIGN                                                   !2, ~8
    7     8        FETCH_OBJ_W                                      $10     !2, 'field_test'
          9        ASSIGN_DIM                                               $10, 'und'
         10        OP_DATA                                                  <array>
    8    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
    9    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
228.77 ms | 999 KiB | 14 Q