3v4l.org

run code in 300+ PHP versions simultaneously
<?php $demos_keys = array("lastname","email","d1","d2"); $csvdata = array("Dryer,fdryer@email.com,Backfield,North\r","Harris,fharris@email.com,Corp,South\r"); $result = array(); foreach ($csvdata as $row) { $data = explode(',', trim($row)); $result[] = array_combine($demos_keys, $data); } print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 20
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/MomQP
function name:  (null)
number of ops:  25
compiled vars:  !0 = $demos_keys, !1 = $csvdata, !2 = $result, !3 = $row, !4 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, <array>
    7     3      > FE_RESET_R                                       $8      !1, ->20
          4    > > FE_FETCH_R                                               $8, !3, ->20
    8     5    >   INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '%2C'
          7        INIT_FCALL                                               'trim'
          8        SEND_VAR                                                 !3
          9        DO_ICALL                                         $9      
         10        SEND_VAR                                                 $9
         11        DO_ICALL                                         $10     
         12        ASSIGN                                                   !4, $10
    9    13        INIT_FCALL                                               'array_combine'
         14        SEND_VAR                                                 !0
         15        SEND_VAR                                                 !4
         16        DO_ICALL                                         $13     
         17        ASSIGN_DIM                                               !2
         18        OP_DATA                                                  $13
    7    19      > JMP                                                      ->4
         20    >   FE_FREE                                                  $8
   11    21        INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.98 ms | 1001 KiB | 17 Q