3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fo = new \SplFileObject('import_mmt_20140701.csv', 'r'); $processedBrands = []; $processedModels = []; $lastBrand = ''; foreach ($fo as $line) { isset($i) ? ++$i : $i = 0; if ($i === 0) continue; if (empty($line)) continue; // Countries (assume country names are already converted to the correct ones): list($countryName, $description, $name) = str_getcsv($line, ';'); $countryName = trim($countryName); $description = trim($description); $name = trim($name); if (!in_array($name, $processedBrands) && !empty($countryName) && !empty($name)) { save_brand([ 'status' => 1, 'country' => $countryName, 'countryId' => item_country($countryName), 'reference' => str_url($name), 'name' => $name, 'description' => $description ]); $processedBrands[] = $name; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 79
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 79
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 24
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 24
2 jumps found. (Code = 46) Position 1 = 53, Position 2 = 56
Branch analysis from position: 53
2 jumps found. (Code = 46) Position 1 = 57, Position 2 = 60
Branch analysis from position: 57
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 78
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 78
Branch analysis from position: 60
Branch analysis from position: 56
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
Branch analysis from position: 21
Branch analysis from position: 79
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 79
filename:       /in/MJ6GM
function name:  (null)
number of ops:  81
compiled vars:  !0 = $fo, !1 = $processedBrands, !2 = $processedModels, !3 = $lastBrand, !4 = $line, !5 = $i, !6 = $countryName, !7 = $description, !8 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $9      'SplFileObject'
          1        SEND_VAL_EX                                              'import_mmt_20140701.csv'
          2        SEND_VAL_EX                                              'r'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $9
    3     5        ASSIGN                                                   !1, <array>
    4     6        ASSIGN                                                   !2, <array>
    5     7        ASSIGN                                                   !3, ''
    7     8      > FE_RESET_R                                       $15     !0, ->79
          9    > > FE_FETCH_R                                               $15, !4, ->79
         10    >   ISSET_ISEMPTY_CV                                         !5
         11      > JMPZ                                                     ~16, ->15
         12    >   PRE_INC                                          ~17     !5
         13        QM_ASSIGN                                        ~18     ~17
         14      > JMP                                                      ->17
         15    >   ASSIGN                                           ~19     !5, 0
         16        QM_ASSIGN                                        ~18     ~19
         17    >   FREE                                                     ~18
    8    18        IS_IDENTICAL                                             !5, 0
         19      > JMPZ                                                     ~20, ->21
         20    > > JMP                                                      ->9
    9    21    >   ISSET_ISEMPTY_CV                                         !4
         22      > JMPZ                                                     ~21, ->24
         23    > > JMP                                                      ->9
   12    24    >   INIT_FCALL                                               'str_getcsv'
         25        SEND_VAR                                                 !4
         26        SEND_VAL                                                 '%3B'
         27        DO_ICALL                                         $22     
         28        FETCH_LIST_R                                     $23     $22, 0
         29        ASSIGN                                                   !6, $23
         30        FETCH_LIST_R                                     $25     $22, 1
         31        ASSIGN                                                   !7, $25
         32        FETCH_LIST_R                                     $27     $22, 2
         33        ASSIGN                                                   !8, $27
         34        FREE                                                     $22
   14    35        INIT_FCALL                                               'trim'
         36        SEND_VAR                                                 !6
         37        DO_ICALL                                         $29     
         38        ASSIGN                                                   !6, $29
   15    39        INIT_FCALL                                               'trim'
         40        SEND_VAR                                                 !7
         41        DO_ICALL                                         $31     
         42        ASSIGN                                                   !7, $31
   16    43        INIT_FCALL                                               'trim'
         44        SEND_VAR                                                 !8
         45        DO_ICALL                                         $33     
         46        ASSIGN                                                   !8, $33
   18    47        INIT_FCALL                                               'in_array'
         48        SEND_VAR                                                 !8
         49        SEND_VAR                                                 !1
         50        DO_ICALL                                         $35     
         51        BOOL_NOT                                         ~36     $35
         52      > JMPZ_EX                                          ~36     ~36, ->56
         53    >   ISSET_ISEMPTY_CV                                 ~37     !6
         54        BOOL_NOT                                         ~38     ~37
         55        BOOL                                             ~36     ~38
         56    > > JMPZ_EX                                          ~36     ~36, ->60
         57    >   ISSET_ISEMPTY_CV                                 ~39     !8
         58        BOOL_NOT                                         ~40     ~39
         59        BOOL                                             ~36     ~40
         60    > > JMPZ                                                     ~36, ->78
   20    61    >   INIT_FCALL_BY_NAME                                       'save_brand'
   21    62        INIT_ARRAY                                       ~41     1, 'status'
   22    63        ADD_ARRAY_ELEMENT                                ~41     !6, 'country'
   23    64        INIT_FCALL_BY_NAME                                       'item_country'
         65        SEND_VAR_EX                                              !6
         66        DO_FCALL                                      0  $42     
         67        ADD_ARRAY_ELEMENT                                ~41     $42, 'countryId'
   24    68        INIT_FCALL_BY_NAME                                       'str_url'
         69        SEND_VAR_EX                                              !8
         70        DO_FCALL                                      0  $43     
         71        ADD_ARRAY_ELEMENT                                ~41     $43, 'reference'
   25    72        ADD_ARRAY_ELEMENT                                ~41     !8, 'name'
   26    73        ADD_ARRAY_ELEMENT                                ~41     !7, 'description'
         74        SEND_VAL_EX                                              ~41
         75        DO_FCALL                                      0          
   29    76        ASSIGN_DIM                                               !1
         77        OP_DATA                                                  !8
    7    78    > > JMP                                                      ->9
         79    >   FE_FREE                                                  $15
   32    80      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.12 ms | 1408 KiB | 19 Q