3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( "0" => Array ( "0" => "Name", "1" => "Company", "2" => "Email", "3" => "City", ), "1" => Array ( "0" => "Foo", "1" => "Foo & co", "2" => "foo@mail.com", "3" => "NY", ), "2" => Array ( "0" => "Bar", "1" => "Bar & co", "2" => "bar@mail.com", "3" => "Las Vegas", ) ); $final_result = array(); foreach($array as $key=>$value){ if($key == 0){ $final_result = array_values($value); }else{ $result[]= array_combine($final_result, array_values($value)); } } echo "<pre>"; print_r($result); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 22
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 22
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/D38vc
function name:  (null)
number of ops:  28
compiled vars:  !0 = $array, !1 = $final_result, !2 = $value, !3 = $key, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   30     1        ASSIGN                                                   !1, <array>
   31     2      > FE_RESET_R                                       $7      !0, ->22
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->22
          4    >   ASSIGN                                                   !3, ~8
   33     5        IS_EQUAL                                                 !3, 0
          6      > JMPZ                                                     ~10, ->12
   34     7    >   INIT_FCALL                                               'array_values'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                         $11     
         10        ASSIGN                                                   !1, $11
   33    11      > JMP                                                      ->21
   37    12    >   INIT_FCALL                                               'array_combine'
         13        SEND_VAR                                                 !1
         14        INIT_FCALL                                               'array_values'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $14     
         17        SEND_VAR                                                 $14
         18        DO_ICALL                                         $15     
         19        ASSIGN_DIM                                               !4
         20        OP_DATA                                                  $15
   31    21    > > JMP                                                      ->3
         22    >   FE_FREE                                                  $7
   41    23        ECHO                                                     '%3Cpre%3E'
   42    24        INIT_FCALL                                               'print_r'
         25        SEND_VAR                                                 !4
         26        DO_ICALL                                                 
   45    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.07 ms | 1440 KiB | 16 Q