3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ['key1' => 1, 'key2' => 2]; $tmp = $arr['key1']; $arr['key1'] = $arr['key2']; $arr['key2'] = $tmp; var_dump($arr);;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rDrdE
function name:  (null)
number of ops:  12
compiled vars:  !0 = $arr, !1 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ASSIGN                                                   !0, <array>
          1        FETCH_DIM_R                                      ~3      !0, 'key1'
          2        ASSIGN                                                   !1, ~3
          3        FETCH_DIM_R                                      ~6      !0, 'key2'
          4        ASSIGN_DIM                                               !0, 'key1'
          5        OP_DATA                                                  ~6
          6        ASSIGN_DIM                                               !0, 'key2'
          7        OP_DATA                                                  !1
          8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.65 ms | 1000 KiB | 14 Q