3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 'index1' => 'Deleted', 'index2' => 'numbers', 'index3' => 'test', 'index4' => 'Inserted', ); $i=0; $specificIndex = array('index3','index2') ; $array1=array(); if(key($array)==$specificIndex[$i]){ $array1[$key] = $value; unset($array[$specificIndex[$i]]); $i++; } print_r($specificIndex); print_r($array); print_r($array1);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/nH1jP
function name:  (null)
number of ops:  25
compiled vars:  !0 = $array, !1 = $i, !2 = $specificIndex, !3 = $array1, !4 = $key, !5 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, 0
    9     2        ASSIGN                                                   !2, <array>
   10     3        ASSIGN                                                   !3, <array>
   12     4        INIT_FCALL                                               'key'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $10     
          7        FETCH_DIM_R                                      ~11     !2, !1
          8        IS_EQUAL                                                 $10, ~11
          9      > JMPZ                                                     ~12, ->15
   13    10    >   ASSIGN_DIM                                               !3, !4
         11        OP_DATA                                                  !5
   14    12        FETCH_DIM_R                                      ~14     !2, !1
         13        UNSET_DIM                                                !0, ~14
   15    14        PRE_INC                                                  !1
   18    15    >   INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
   19    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
   20    21        INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.87 ms | 1395 KiB | 17 Q