3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = array('SS2014','SU2014','FW2014','SS2013','FW2013','NW2012'); $cleanUpResult = array(); $counter = 0; $previousYear = ''; $currentIndex = 10; var_dump($strings); foreach($strings as $row){ if($counter == 0){ $previousYear = substr($row, -4); } var_dump('fist row'); var_dump($row); var_dump($counter); if($previousYear !== substr($row, -4)){ $currentIndex = $currentIndex + 10; } if($counter > 0){ $previousYear = substr($row, -4); } switch(substr($row, 0, 2)){ case 'SS': $cleanUpResult[$currentIndex + 1] = $row; break; case 'SU': $cleanUpResult[$currentIndex + 2] = $row; break; case 'FW': var_dump($part, $row); $cleanUpResult[$currentIndex + 3] = $row; break; case 'WI': $cleanUpResult[$currentIndex + 4] = $row; break; case 'XM': $cleanUpResult[$currentIndex + 5] = $row; break; case 'CO': $cleanUpResult[$currentIndex + 6] = $row; break; case 'NW': $cleanUpResult[$currentIndex + 7] = $row; break; default: break; } $cleanUpResult[] = $row; $counter++; } var_dump($cleanUpResult);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 100
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 100
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 41
Branch analysis from position: 36
9 jumps found. (Code = 188) Position 1 = 62, Position 2 = 66, Position 3 = 70, Position 4 = 78, Position 5 = 82, Position 6 = 86, Position 7 = 90, Position 8 = 94, Position 9 = 47
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 95
Branch analysis from position: 95
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 95
Branch analysis from position: 95
Branch analysis from position: 70
1 jumps found. (Code = 42) Position 1 = 95
Branch analysis from position: 95
Branch analysis from position: 78
1 jumps found. (Code = 42) Position 1 = 95
Branch analysis from position: 95
Branch analysis from position: 82
1 jumps found. (Code = 42) Position 1 = 95
Branch analysis from position: 95
Branch analysis from position: 86
1 jumps found. (Code = 42) Position 1 = 95
Branch analysis from position: 95
Branch analysis from position: 90
1 jumps found. (Code = 42) Position 1 = 95
Branch analysis from position: 95
Branch analysis from position: 94
1 jumps found. (Code = 42) Position 1 = 95
Branch analysis from position: 95
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 62
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 66
Branch analysis from position: 51
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 70
Branch analysis from position: 53
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 78
Branch analysis from position: 55
2 jumps found. (Code = 44) Position 1 = 57, Position 2 = 82
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 59, Position 2 = 86
Branch analysis from position: 59
2 jumps found. (Code = 44) Position 1 = 61, Position 2 = 90
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 94
Branch analysis from position: 94
Branch analysis from position: 90
Branch analysis from position: 86
Branch analysis from position: 82
Branch analysis from position: 78
Branch analysis from position: 70
Branch analysis from position: 66
Branch analysis from position: 62
Branch analysis from position: 41
Branch analysis from position: 34
Branch analysis from position: 17
Branch analysis from position: 100
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 100
filename:       /in/kBAno
function name:  (null)
number of ops:  105
compiled vars:  !0 = $strings, !1 = $cleanUpResult, !2 = $counter, !3 = $previousYear, !4 = $currentIndex, !5 = $row, !6 = $part
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, 0
    7     3        ASSIGN                                                   !3, ''
    8     4        ASSIGN                                                   !4, 10
    9     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   10     8      > FE_RESET_R                                       $13     !0, ->100
          9    > > FE_FETCH_R                                               $13, !5, ->100
   12    10    >   IS_EQUAL                                                 !2, 0
         11      > JMPZ                                                     ~14, ->17
   13    12    >   INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !5
         14        SEND_VAL                                                 -4
         15        DO_ICALL                                         $15     
         16        ASSIGN                                                   !3, $15
   16    17    >   INIT_FCALL                                               'var_dump'
         18        SEND_VAL                                                 'fist+row'
         19        DO_ICALL                                                 
   17    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !5
         22        DO_ICALL                                                 
   18    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                                 
   20    26        INIT_FCALL                                               'substr'
         27        SEND_VAR                                                 !5
         28        SEND_VAL                                                 -4
         29        DO_ICALL                                         $20     
         30        IS_NOT_IDENTICAL                                         !3, $20
         31      > JMPZ                                                     ~21, ->34
   21    32    >   ADD                                              ~22     !4, 10
         33        ASSIGN                                                   !4, ~22
   24    34    >   IS_SMALLER                                               0, !2
         35      > JMPZ                                                     ~24, ->41
   25    36    >   INIT_FCALL                                               'substr'
         37        SEND_VAR                                                 !5
         38        SEND_VAL                                                 -4
         39        DO_ICALL                                         $25     
         40        ASSIGN                                                   !3, $25
   28    41    >   INIT_FCALL                                               'substr'
         42        SEND_VAR                                                 !5
         43        SEND_VAL                                                 0
         44        SEND_VAL                                                 2
         45        DO_ICALL                                         $27     
         46      > SWITCH_STRING                                            $27, [ 'SS':->62, 'SU':->66, 'FW':->70, 'WI':->78, 'XM':->82, 'CO':->86, 'NW':->90, ], ->94
   29    47    >   CASE                                                     $27, 'SS'
         48      > JMPNZ                                                    ~28, ->62
   32    49    >   CASE                                                     $27, 'SU'
         50      > JMPNZ                                                    ~28, ->66
   35    51    >   CASE                                                     $27, 'FW'
         52      > JMPNZ                                                    ~28, ->70
   39    53    >   CASE                                                     $27, 'WI'
         54      > JMPNZ                                                    ~28, ->78
   42    55    >   CASE                                                     $27, 'XM'
         56      > JMPNZ                                                    ~28, ->82
   45    57    >   CASE                                                     $27, 'CO'
         58      > JMPNZ                                                    ~28, ->86
   48    59    >   CASE                                                     $27, 'NW'
         60      > JMPNZ                                                    ~28, ->90
         61    > > JMP                                                      ->94
   30    62    >   ADD                                              ~29     !4, 1
         63        ASSIGN_DIM                                               !1, ~29
         64        OP_DATA                                                  !5
   31    65      > JMP                                                      ->95
   33    66    >   ADD                                              ~31     !4, 2
         67        ASSIGN_DIM                                               !1, ~31
         68        OP_DATA                                                  !5
   34    69      > JMP                                                      ->95
   36    70    >   INIT_FCALL                                               'var_dump'
         71        SEND_VAR                                                 !6
         72        SEND_VAR                                                 !5
         73        DO_ICALL                                                 
   37    74        ADD                                              ~34     !4, 3
         75        ASSIGN_DIM                                               !1, ~34
         76        OP_DATA                                                  !5
   38    77      > JMP                                                      ->95
   40    78    >   ADD                                              ~36     !4, 4
         79        ASSIGN_DIM                                               !1, ~36
         80        OP_DATA                                                  !5
   41    81      > JMP                                                      ->95
   43    82    >   ADD                                              ~38     !4, 5
         83        ASSIGN_DIM                                               !1, ~38
         84        OP_DATA                                                  !5
   44    85      > JMP                                                      ->95
   46    86    >   ADD                                              ~40     !4, 6
         87        ASSIGN_DIM                                               !1, ~40
         88        OP_DATA                                                  !5
   47    89      > JMP                                                      ->95
   49    90    >   ADD                                              ~42     !4, 7
         91        ASSIGN_DIM                                               !1, ~42
         92        OP_DATA                                                  !5
   50    93      > JMP                                                      ->95
   52    94    > > JMP                                                      ->95
         95    >   FREE                                                     $27
   56    96        ASSIGN_DIM                                               !1
         97        OP_DATA                                                  !5
   57    98        PRE_INC                                                  !2
   10    99      > JMP                                                      ->9
        100    >   FE_FREE                                                  $13
   59   101        INIT_FCALL                                               'var_dump'
        102        SEND_VAR                                                 !1
        103        DO_ICALL                                                 
        104      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.33 ms | 1404 KiB | 17 Q