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); } $part = substr($row, 0, 2); switch($part){ 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 = 63, Position 2 = 67, Position 3 = 71, Position 4 = 79, Position 5 = 83, Position 6 = 87, Position 7 = 91, Position 8 = 95, Position 9 = 48
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
Branch analysis from position: 71
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
Branch analysis from position: 79
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
Branch analysis from position: 83
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
Branch analysis from position: 87
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
Branch analysis from position: 91
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
Branch analysis from position: 95
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 63
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 52, Position 2 = 67
Branch analysis from position: 52
2 jumps found. (Code = 44) Position 1 = 54, Position 2 = 71
Branch analysis from position: 54
2 jumps found. (Code = 44) Position 1 = 56, Position 2 = 79
Branch analysis from position: 56
2 jumps found. (Code = 44) Position 1 = 58, Position 2 = 83
Branch analysis from position: 58
2 jumps found. (Code = 44) Position 1 = 60, Position 2 = 87
Branch analysis from position: 60
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 91
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 95
Branch analysis from position: 95
Branch analysis from position: 91
Branch analysis from position: 87
Branch analysis from position: 83
Branch analysis from position: 79
Branch analysis from position: 71
Branch analysis from position: 67
Branch analysis from position: 63
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/kfVfi
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
   27    41    >   INIT_FCALL                                               'substr'
         42        SEND_VAR                                                 !5
         43        SEND_VAL                                                 0
         44        SEND_VAL                                                 2
         45        DO_ICALL                                         $27     
         46        ASSIGN                                                   !6, $27
   29    47      > SWITCH_STRING                                            !6, [ 'SS':->63, 'SU':->67, 'FW':->71, 'WI':->79, 'XM':->83, 'CO':->87, 'NW':->91, ], ->95
   30    48    >   IS_EQUAL                                                 !6, 'SS'
         49      > JMPNZ                                                    ~29, ->63
   33    50    >   IS_EQUAL                                                 !6, 'SU'
         51      > JMPNZ                                                    ~29, ->67
   36    52    >   IS_EQUAL                                                 !6, 'FW'
         53      > JMPNZ                                                    ~29, ->71
   40    54    >   IS_EQUAL                                                 !6, 'WI'
         55      > JMPNZ                                                    ~29, ->79
   43    56    >   IS_EQUAL                                                 !6, 'XM'
         57      > JMPNZ                                                    ~29, ->83
   46    58    >   IS_EQUAL                                                 !6, 'CO'
         59      > JMPNZ                                                    ~29, ->87
   49    60    >   IS_EQUAL                                                 !6, 'NW'
         61      > JMPNZ                                                    ~29, ->91
         62    > > JMP                                                      ->95
   31    63    >   ADD                                              ~30     !4, 1
         64        ASSIGN_DIM                                               !1, ~30
         65        OP_DATA                                                  !5
   32    66      > JMP                                                      ->96
   34    67    >   ADD                                              ~32     !4, 2
         68        ASSIGN_DIM                                               !1, ~32
         69        OP_DATA                                                  !5
   35    70      > JMP                                                      ->96
   37    71    >   INIT_FCALL                                               'var_dump'
         72        SEND_VAR                                                 !6
         73        SEND_VAR                                                 !5
         74        DO_ICALL                                                 
   38    75        ADD                                              ~35     !4, 3
         76        ASSIGN_DIM                                               !1, ~35
         77        OP_DATA                                                  !5
   39    78      > JMP                                                      ->96
   41    79    >   ADD                                              ~37     !4, 4
         80        ASSIGN_DIM                                               !1, ~37
         81        OP_DATA                                                  !5
   42    82      > JMP                                                      ->96
   44    83    >   ADD                                              ~39     !4, 5
         84        ASSIGN_DIM                                               !1, ~39
         85        OP_DATA                                                  !5
   45    86      > JMP                                                      ->96
   47    87    >   ADD                                              ~41     !4, 6
         88        ASSIGN_DIM                                               !1, ~41
         89        OP_DATA                                                  !5
   48    90      > JMP                                                      ->96
   50    91    >   ADD                                              ~43     !4, 7
         92        ASSIGN_DIM                                               !1, ~43
         93        OP_DATA                                                  !5
   51    94      > JMP                                                      ->96
   53    95    > > JMP                                                      ->96
   57    96    >   ASSIGN_DIM                                               !1
         97        OP_DATA                                                  !5
   58    98        PRE_INC                                                  !2
   10    99      > JMP                                                      ->9
        100    >   FE_FREE                                                  $13
   60   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:
159.05 ms | 1404 KiB | 17 Q