3v4l.org

run code in 500+ PHP versions simultaneously
<?php $strings = ["name,firstname,Bob", "name,lastname,Dylan"]; $result = []; foreach ($strings as $csv) { [$level1, $level2, $value] = str_getcsv($csv); $result[$level1][$level2] = $value; } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/erQco
function name:  (null)
number of ops:  23
compiled vars:  !0 = $strings, !1 = $result, !2 = $csv, !3 = $level1, !4 = $level2, !5 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, <array>
    5     2      > FE_RESET_R                                           $8      !0, ->18
          3    > > FE_FETCH_R                                                   $8, !2, ->18
    6     4    >   INIT_FCALL                                                   'str_getcsv'
          5        SEND_VAR                                                     !2
          6        DO_ICALL                                             $9      
          7        FETCH_LIST_R                                         $10     $9, 0
          8        ASSIGN                                                       !3, $10
          9        FETCH_LIST_R                                         $12     $9, 1
         10        ASSIGN                                                       !4, $12
         11        FETCH_LIST_R                                         $14     $9, 2
         12        ASSIGN                                                       !5, $14
         13        FREE                                                         $9
    7    14        FETCH_DIM_W                                          $16     !1, !3
         15        ASSIGN_DIM                                                   $16, !4
         16        OP_DATA                                                      !5
    5    17      > JMP                                                          ->3
         18    >   FE_FREE                                                      $8
    9    19        INIT_FCALL                                                   'var_export'
         20        SEND_VAR                                                     !1
         21        DO_ICALL                                                     
         22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
149.56 ms | 1879 KiB | 15 Q