3v4l.org

run code in 300+ PHP versions simultaneously
<?php $reader = array(array ( 0 => 'Phone', 1 => 'Sum', 2 => 'Name', 3 => 'Something else', ), array ( 0 => '+1 555123456', 1 => 50.00, 2 => 'Johnny Doe', 3 => 100.50 ), array ( 0 => '911', 1 => 20.12, 2 => 'Eli the Computer Guy', 3 => 99.99 )); $row = 1; // header row $new_array = array(); foreach ($reader as $data) { if ($row == 1) { $headers = $data; } else { $new_array[] = array_combine($headers, $data); } $row++; } print_r($new_array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/aAPQq
function name:  (null)
number of ops:  22
compiled vars:  !0 = $reader, !1 = $row, !2 = $new_array, !3 = $data, !4 = $headers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   25     1        ASSIGN                                                   !1, 1
   26     2        ASSIGN                                                   !2, <array>
   27     3      > FE_RESET_R                                       $8      !0, ->17
          4    > > FE_FETCH_R                                               $8, !3, ->17
   29     5    >   IS_EQUAL                                                 !1, 1
          6      > JMPZ                                                     ~9, ->9
   31     7    >   ASSIGN                                                   !4, !3
   29     8      > JMP                                                      ->15
   35     9    >   INIT_FCALL                                               'array_combine'
         10        SEND_VAR                                                 !4
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $12     
         13        ASSIGN_DIM                                               !2
         14        OP_DATA                                                  $12
   37    15    >   PRE_INC                                                  !1
   27    16      > JMP                                                      ->4
         17    >   FE_FREE                                                  $8
   39    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.33 ms | 1006 KiB | 15 Q