3v4l.org

run code in 500+ 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 = 18
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/MomQP
function name:  (null)
number of ops:  23
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, ->18
          4    > > FE_FETCH_R                                                   $8, !3, ->18
    8     5    >   INIT_FCALL                                                   'explode'
          6        SEND_VAL                                                     '%2C'
          7        FRAMELESS_ICALL_1                trim                ~9      !3
          8        SEND_VAL                                                     ~9
          9        DO_ICALL                                             $10     
         10        ASSIGN                                                       !4, $10
    9    11        INIT_FCALL                                                   'array_combine'
         12        SEND_VAR                                                     !0
         13        SEND_VAR                                                     !4
         14        DO_ICALL                                             $13     
         15        ASSIGN_DIM                                                   !2
         16        OP_DATA                                                      $13
    7    17      > JMP                                                          ->4
         18    >   FE_FREE                                                      $8
   11    19        INIT_FCALL                                                   'print_r'
         20        SEND_VAR                                                     !2
         21        DO_ICALL                                                     
         22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.69 ms | 2050 KiB | 16 Q