3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x='initial'; $test=array('A'=>&$x,'B'=>&$x); $test=unserialize(serialize($test)); $test['A']='changed'; echo $test['B']; // Outputs "changed"
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/51X6Y
function name:  (null)
number of ops:  16
compiled vars:  !0 = $x, !1 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'initial'
    3     1        INIT_ARRAY                                       ~3      !0, 'A'
          2        ADD_ARRAY_ELEMENT                                ~3      !0, 'B'
          3        ASSIGN                                                   !1, ~3
    4     4        INIT_FCALL                                               'unserialize'
          5        INIT_FCALL                                               'serialize'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !1, $6
    5    11        ASSIGN_DIM                                               !1, 'A'
         12        OP_DATA                                                  'changed'
    6    13        FETCH_DIM_R                                      ~9      !1, 'B'
         14        ECHO                                                     ~9
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.97 ms | 1398 KiB | 17 Q