3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ '2018-03-12' => [ 'United States' => 4, 'Australia' => 15, 'United Kingdom' => 0, 'New Zealand' => 0, ], '2018-03-13' => [ 'United States' => 0, 'Australia' => 8, 'United Kingdom' => 2, 'New Zealand' => 0, ] ]; foreach ($array as $key => $subarray) { $result[] = array_merge([$key], array_values($subarray)); } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 15
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/FqrUX
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array, !1 = $subarray, !2 = $key, !3 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   17     1      > FE_RESET_R                                           $5      !0, ->15
          2    > > FE_FETCH_R                                           ~6      $5, !1, ->15
          3    >   ASSIGN                                                       !2, ~6
   18     4        INIT_FCALL                                                   'array_merge'
          5        INIT_ARRAY                                           ~9      !2
          6        SEND_VAL                                                     ~9
          7        INIT_FCALL                                                   'array_values'
          8        SEND_VAR                                                     !1
          9        DO_ICALL                                             $10     
         10        SEND_VAR                                                     $10
         11        DO_ICALL                                             $11     
         12        ASSIGN_DIM                                                   !3
         13        OP_DATA                                                      $11
   17    14      > JMP                                                          ->2
         15    >   FE_FREE                                                      $5
   21    16        INIT_FCALL                                                   'var_export'
         17        SEND_VAR                                                     !3
         18        DO_ICALL                                                     
         19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170 ms | 2642 KiB | 16 Q