3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.87 ms | 1395 KiB | 17 Q