3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.06 ms | 1395 KiB | 17 Q