3v4l.org

run code in 300+ PHP versions simultaneously
3<?php $array = array( 8 => 'string1', 4 => 'string2', 3 => 'string3', 5 => 'string4'); $arrays =$array; print_r($array); $array=array(); $i=0; foreach($arrays as $k => $item) { $array[$i]=$item; unset($arrays[$k]); $i++; } print_r($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/AQZLv
function name:  (null)
number of ops:  21
compiled vars:  !0 = $array, !1 = $arrays, !2 = $i, !3 = $item, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '3'
    3     1        ASSIGN                                                   !0, <array>
    4     2        ASSIGN                                                   !1, !0
    5     3        INIT_FCALL                                               'print_r'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
    6     6        ASSIGN                                                   !0, <array>
    7     7        ASSIGN                                                   !2, 0
    8     8      > FE_RESET_R                                       $10     !1, ->16
          9    > > FE_FETCH_R                                       ~11     $10, !3, ->16
         10    >   ASSIGN                                                   !4, ~11
   10    11        ASSIGN_DIM                                               !0, !2
         12        OP_DATA                                                  !3
   11    13        UNSET_DIM                                                !1, !4
   12    14        PRE_INC                                                  !2
    8    15      > JMP                                                      ->9
         16    >   FE_FREE                                                  $10
   16    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.85 ms | 1395 KiB | 15 Q