3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 0 => 'string1', 1 => 'string2', 2 => 'string3', 3 => 'string4'); $arrays =$array; print_r($array); $array=array(); $i=0; foreach($arrays as $k => $item) { if($item == 'string2'){ unset($arrays[$k]); } $i++; } print_r(array_values($arrays));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 13
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/ti73W
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        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
    6     5        ASSIGN                                                   !0, <array>
    7     6        ASSIGN                                                   !2, 0
    8     7      > FE_RESET_R                                       $10     !1, ->15
          8    > > FE_FETCH_R                                       ~11     $10, !3, ->15
          9    >   ASSIGN                                                   !4, ~11
   11    10        IS_EQUAL                                                 !3, 'string2'
         11      > JMPZ                                                     ~13, ->13
   12    12    >   UNSET_DIM                                                !1, !4
   14    13    >   PRE_INC                                                  !2
    8    14      > JMP                                                      ->8
         15    >   FE_FREE                                                  $10
   18    16        INIT_FCALL                                               'print_r'
         17        INIT_FCALL                                               'array_values'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $15     
         20        SEND_VAR                                                 $15
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.67 ms | 1395 KiB | 17 Q