3v4l.org

run code in 300+ PHP versions simultaneously
<?php $csv = <<< CSV "LOADERS", "S130", "Above & 524611001, 524711001 & Above", "MAINTENANCE ITEMS", "SCHEDULED MAINTENANCE ITEMS (500 HOUR)" "", "", "Above & 524611001, 524711001 & Above", "MAINTENANCE ITEMS", "SCHEDULED MAINTENANCE ITEMS (1000 HOUR)" "", "S140", "Above & 524611001, 524711001 & Above", "MAIN FRAME", "OPERATOR CAB" CSV; foreach(preg_split("/(\r?\n)/", $csv) as $line) { list($column1, $column2, $column3, $column4) = explode('", "', $line); //$column1 = preg_replace('/^"/', '', $column1); //$column4 = preg_replace('/\"(?<!\\")/', '', $column4); //foreach(explode(', ', $column3) as $column3_part) { // $temp_array[$column3_part][] = $column4; //} $big_array[$column1][$column2] = $temp_array; } echo '<pre>' . print_r($big_array, 1) . '</pre><hr />'; $counter = 50; foreach($big_array as $key1 => $level1) { foreach($level1 as $key2 => $level2) { foreach($level2 as $key3 => $level4) { foreach($level4 as $level5) { echo '<pre>' . print_r('INSERT INTO DATABASE: ' . $counter . ', ' . $key1 . ', ' . $key2 . ', ' . $key3 . ', ' . $level5, 1) . '</pre>'; $counter++; } } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 24
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 24
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 24
2 jumps found. (Code = 77) Position 1 = 34, Position 2 = 68
Branch analysis from position: 34
2 jumps found. (Code = 78) Position 1 = 35, Position 2 = 68
Branch analysis from position: 35
2 jumps found. (Code = 77) Position 1 = 37, Position 2 = 66
Branch analysis from position: 37
2 jumps found. (Code = 78) Position 1 = 38, Position 2 = 66
Branch analysis from position: 38
2 jumps found. (Code = 77) Position 1 = 40, Position 2 = 64
Branch analysis from position: 40
2 jumps found. (Code = 78) Position 1 = 41, Position 2 = 64
Branch analysis from position: 41
2 jumps found. (Code = 77) Position 1 = 43, Position 2 = 62
Branch analysis from position: 43
2 jumps found. (Code = 78) Position 1 = 44, Position 2 = 62
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
Branch analysis from position: 62
Branch analysis from position: 64
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 64
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 66
Branch analysis from position: 68
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 68
Branch analysis from position: 24
filename:       /in/MDb8j
function name:  (null)
number of ops:  70
compiled vars:  !0 = $csv, !1 = $line, !2 = $column1, !3 = $column2, !4 = $column3, !5 = $column4, !6 = $big_array, !7 = $temp_array, !8 = $counter, !9 = $level1, !10 = $key1, !11 = $level2, !12 = $key2, !13 = $level4, !14 = $key3, !15 = $level5
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%22LOADERS%22%2C+%22S130%22%2C+%22Above+%26+524611001%2C+524711001+%26+Above%22%2C+%22MAINTENANCE+ITEMS%22%2C+%22SCHEDULED+MAINTENANCE+ITEMS+%28500+HOUR%29%22%0A%22%22%2C+%22%22%2C+%22Above+%26+524611001%2C+524711001+%26+Above%22%2C+%22MAINTENANCE+ITEMS%22%2C+%22SCHEDULED+MAINTENANCE+ITEMS+%281000+HOUR%29%22%0A%22%22%2C+%22S140%22%2C+%22Above+%26+524611001%2C+524711001+%26+Above%22%2C+%22MAIN+FRAME%22%2C+%22OPERATOR+CAB%22'
    8     1        INIT_FCALL                                               'preg_split'
          2        SEND_VAL                                                 '%2F%28%0D%3F%0A%29%2F'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $17     
          5      > FE_RESET_R                                       $18     $17, ->24
          6    > > FE_FETCH_R                                               $18, !1, ->24
   10     7    >   INIT_FCALL                                               'explode'
          8        SEND_VAL                                                 '%22%2C+%22'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $19     
         11        FETCH_LIST_R                                     $20     $19, 0
         12        ASSIGN                                                   !2, $20
         13        FETCH_LIST_R                                     $22     $19, 1
         14        ASSIGN                                                   !3, $22
         15        FETCH_LIST_R                                     $24     $19, 2
         16        ASSIGN                                                   !4, $24
         17        FETCH_LIST_R                                     $26     $19, 3
         18        ASSIGN                                                   !5, $26
         19        FREE                                                     $19
   20    20        FETCH_DIM_W                                      $28     !6, !2
         21        ASSIGN_DIM                                               $28, !3
         22        OP_DATA                                                  !7
    8    23      > JMP                                                      ->6
         24    >   FE_FREE                                                  $18
   23    25        INIT_FCALL                                               'print_r'
         26        SEND_VAR                                                 !6
         27        SEND_VAL                                                 1
         28        DO_ICALL                                         $30     
         29        CONCAT                                           ~31     '%3Cpre%3E', $30
         30        CONCAT                                           ~32     ~31, '%3C%2Fpre%3E%3Chr+%2F%3E'
         31        ECHO                                                     ~32
   25    32        ASSIGN                                                   !8, 50
   26    33      > FE_RESET_R                                       $34     !6, ->68
         34    > > FE_FETCH_R                                       ~35     $34, !9, ->68
         35    >   ASSIGN                                                   !10, ~35
   27    36      > FE_RESET_R                                       $37     !9, ->66
         37    > > FE_FETCH_R                                       ~38     $37, !11, ->66
         38    >   ASSIGN                                                   !12, ~38
   28    39      > FE_RESET_R                                       $40     !11, ->64
         40    > > FE_FETCH_R                                       ~41     $40, !13, ->64
         41    >   ASSIGN                                                   !14, ~41
   29    42      > FE_RESET_R                                       $43     !13, ->62
         43    > > FE_FETCH_R                                               $43, !15, ->62
   31    44    >   INIT_FCALL                                               'print_r'
         45        CONCAT                                           ~44     'INSERT+INTO+DATABASE%3A+', !8
         46        CONCAT                                           ~45     ~44, '%2C+'
         47        CONCAT                                           ~46     ~45, !10
         48        CONCAT                                           ~47     ~46, '%2C+'
         49        CONCAT                                           ~48     ~47, !12
         50        CONCAT                                           ~49     ~48, '%2C+'
         51        CONCAT                                           ~50     ~49, !14
         52        CONCAT                                           ~51     ~50, '%2C+'
         53        CONCAT                                           ~52     ~51, !15
         54        SEND_VAL                                                 ~52
         55        SEND_VAL                                                 1
         56        DO_ICALL                                         $53     
         57        CONCAT                                           ~54     '%3Cpre%3E', $53
         58        CONCAT                                           ~55     ~54, '%3C%2Fpre%3E'
         59        ECHO                                                     ~55
   32    60        PRE_INC                                                  !8
   29    61      > JMP                                                      ->43
         62    >   FE_FREE                                                  $43
   28    63      > JMP                                                      ->40
         64    >   FE_FREE                                                  $40
   27    65      > JMP                                                      ->37
         66    >   FE_FREE                                                  $37
   26    67      > JMP                                                      ->34
         68    >   FE_FREE                                                  $34
   36    69      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.24 ms | 1409 KiB | 19 Q