3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.27 ms | 1395 KiB | 15 Q