3v4l.org

run code in 500+ PHP versions simultaneously
<?php $csv = <<<TXT "1","July 1999"," 2,782,546 "," $17.38 "," $338,545.98 "," 3,004 ","" "2","August 1999"," 2,739,441 "," $18.68 "," $153,343.98 "," 3,023 ","" "3","September 1999"," 2,650,431 "," $20.86 "," $308,929.17 "," 3,042 ","" TXT; $data = []; foreach ( array_map('str_getcsv', explode("\n\n", $csv)) as $row ) { $data[$row[1]] = array_slice($row, 2, -1); } $result = []; foreach ($data as $k => $row) { foreach ($row as $i => $v) { $result[$i][$k] = trim($v); } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 21
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 21
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 21
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 36
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 36
Branch analysis from position: 25
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 34
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 34
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 34
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
Branch analysis from position: 21
filename:       /in/X2T5l
function name:  (null)
number of ops:  41
compiled vars:  !0 = $csv, !1 = $data, !2 = $row, !3 = $result, !4 = $k, !5 = $v, !6 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%221%22%2C%22July+1999%22%2C%22+2%2C782%2C546+%22%2C%22+%2417.38+%22%2C%22+%24338%2C545.98+%22%2C%22+3%2C004+%22%2C%22%22%0A%0A%222%22%2C%22August+1999%22%2C%22+2%2C739%2C441+%22%2C%22+%2418.68+%22%2C%22+%24153%2C343.98+%22%2C%22+3%2C023+%22%2C%22%22%0A%0A%223%22%2C%22September+1999%22%2C%22+2%2C650%2C431+%22%2C%22+%2420.86+%22%2C%22+%24308%2C929.17+%22%2C%22+3%2C042+%22%2C%22%22'
   11     1        ASSIGN                                                       !1, <array>
   13     2        INIT_FCALL                                                   'array_map'
          3        SEND_VAL                                                     'str_getcsv'
          4        INIT_FCALL                                                   'explode'
          5        SEND_VAL                                                     '%0A%0A'
          6        SEND_VAR                                                     !0
          7        DO_ICALL                                             $9      
          8        SEND_VAR                                                     $9
          9        DO_ICALL                                             $10     
         10      > FE_RESET_R                                           $11     $10, ->21
         11    > > FE_FETCH_R                                                   $11, !2, ->21
   17    12    >   FETCH_DIM_R                                          ~12     !2, 1
         13        INIT_FCALL                                                   'array_slice'
         14        SEND_VAR                                                     !2
         15        SEND_VAL                                                     2
         16        SEND_VAL                                                     -1
         17        DO_ICALL                                             $14     
         18        ASSIGN_DIM                                                   !1, ~12
         19        OP_DATA                                                      $14
   13    20      > JMP                                                          ->11
         21    >   FE_FREE                                                      $11
   20    22        ASSIGN                                                       !3, <array>
   21    23      > FE_RESET_R                                           $16     !1, ->36
         24    > > FE_FETCH_R                                           ~17     $16, !2, ->36
         25    >   ASSIGN                                                       !4, ~17
   22    26      > FE_RESET_R                                           $19     !2, ->34
         27    > > FE_FETCH_R                                           ~20     $19, !5, ->34
         28    >   ASSIGN                                                       !6, ~20
   23    29        FRAMELESS_ICALL_1                trim                ~24     !5
         30        FETCH_DIM_W                                          $22     !3, !6
         31        ASSIGN_DIM                                                   $22, !4
         32        OP_DATA                                                      ~24
   22    33      > JMP                                                          ->27
         34    >   FE_FREE                                                      $19
   21    35      > JMP                                                          ->24
         36    >   FE_FREE                                                      $16
   26    37        INIT_FCALL                                                   'var_export'
         38        SEND_VAR                                                     !3
         39        DO_ICALL                                                     
         40      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.15 ms | 1974 KiB | 17 Q