3v4l.org

run code in 300+ PHP versions simultaneously
<?php $aarray = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); echo "Testing case 1\n"; foreach ($array as $key => $value) { unset($aarray[$kkey+1]); echo sprintf("on %s, we removed %s\n, current size is %d", $key, $key+1, count($array)); } echo "Testing case 2\n"; foreach ((array) $array as $key => $value) { unset($aarray[$key+1]); echo sprintf("on %s, we removed %s\n, current size is %d", $key, $key+1, count($array)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 35
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 35
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 17
filename:       /in/F7E5s
function name:  (null)
number of ops:  37
compiled vars:  !0 = $aarray, !1 = $array, !2 = $value, !3 = $key, !4 = $kkey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ECHO                                                     'Testing+case+1%0A'
    7     2      > FE_RESET_R                                       $6      !1, ->17
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->17
          4    >   ASSIGN                                                   !3, ~7
    8     5        ADD                                              ~9      !4, 1
          6        UNSET_DIM                                                !0, ~9
    9     7        INIT_FCALL                                               'sprintf'
          8        SEND_VAL                                                 'on+%25s%2C+we+removed+%25s%0A%2C+current+size+is+%25d'
          9        SEND_VAR                                                 !3
         10        ADD                                              ~10     !3, 1
         11        SEND_VAL                                                 ~10
         12        COUNT                                            ~11     !1
         13        SEND_VAL                                                 ~11
         14        DO_ICALL                                         $12     
         15        ECHO                                                     $12
    7    16      > JMP                                                      ->3
         17    >   FE_FREE                                                  $6
   12    18        ECHO                                                     'Testing+case+2%0A'
   14    19        CAST                                          7  ~13     !1
         20      > FE_RESET_R                                       $14     ~13, ->35
         21    > > FE_FETCH_R                                       ~15     $14, !2, ->35
         22    >   ASSIGN                                                   !3, ~15
   15    23        ADD                                              ~17     !3, 1
         24        UNSET_DIM                                                !0, ~17
   16    25        INIT_FCALL                                               'sprintf'
         26        SEND_VAL                                                 'on+%25s%2C+we+removed+%25s%0A%2C+current+size+is+%25d'
         27        SEND_VAR                                                 !3
         28        ADD                                              ~18     !3, 1
         29        SEND_VAL                                                 ~18
         30        COUNT                                            ~19     !1
         31        SEND_VAL                                                 ~19
         32        DO_ICALL                                         $20     
         33        ECHO                                                     $20
   14    34      > JMP                                                      ->21
         35    >   FE_FREE                                                  $14
   17    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.93 ms | 1400 KiB | 15 Q