3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( "1" => Array ( "0" => "16/03/2018", "1" => "Friday", "2" => "21.00", "3" => "Friendly Match", "4" => "Italy vs France", "5" => "Truesports HD", ), "2" => Array ( "0" => "17/03/2018", "1" => "Saturday", "2" => "15.30", "3" => "Friendly Match", "4" => "Italy vs Pakistan", "5" => "Truesports HD", ), "3" => Array ( "0" => "17/03/2018", "1" => "Saturday", "2" => "19.00", "3" => "Friendly Match", "4" => "Spain vs USA", "5" => "Truesports" ) ); $array_keys= array("date","day","time","type","value","tv"); $new_array = array(); foreach ($array as $key => $value) { $tmp_array = array(); foreach ($value as $key1 => $value1) { $tmp_array[$array_keys[$key1]] = $value1; } $new_array[] =$tmp_array; } echo json_encode($new_array, JSON_PRETTY_PRINT);
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
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/ah0ef
function name:  (null)
number of ops:  25
compiled vars:  !0 = $array, !1 = $array_keys, !2 = $new_array, !3 = $value, !4 = $key, !5 = $tmp_array, !6 = $value1, !7 = $key1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   34     1        ASSIGN                                                   !1, <array>
   35     2        ASSIGN                                                   !2, <array>
   36     3      > FE_RESET_R                                       $11     !0, ->18
          4    > > FE_FETCH_R                                       ~12     $11, !3, ->18
          5    >   ASSIGN                                                   !4, ~12
   37     6        ASSIGN                                                   !5, <array>
   38     7      > FE_RESET_R                                       $15     !3, ->14
          8    > > FE_FETCH_R                                       ~16     $15, !6, ->14
          9    >   ASSIGN                                                   !7, ~16
   39    10        FETCH_DIM_R                                      ~18     !1, !7
         11        ASSIGN_DIM                                               !5, ~18
         12        OP_DATA                                                  !6
   38    13      > JMP                                                      ->8
         14    >   FE_FREE                                                  $15
   41    15        ASSIGN_DIM                                               !2
         16        OP_DATA                                                  !5
   36    17      > JMP                                                      ->4
         18    >   FE_FREE                                                  $11
   44    19        INIT_FCALL                                               'json_encode'
         20        SEND_VAR                                                 !2
         21        SEND_VAL                                                 128
         22        DO_ICALL                                         $21     
         23        ECHO                                                     $21
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.48 ms | 985 KiB | 14 Q