3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = Array ( '0' => Array ( 'name' => 'Viettel', 'data' => Array ( '0' => '1559881644000,500' ) ), '1' => Array ( 'name' => 'FPT', 'data' => Array ( '0' => '1559994465000,172' ) ), '2' => Array ( 'name' => 'MobiFone', 'data' => Array ( '0' => '1559997314000,11164' ) ), '3' => Array ( 'name' => 'Vietnamobile', 'data' => Array ( '0' => '1559993699000,1246' ) ), '4' => Array ( 'name' => 'Viettel', 'data' => Array ( '0' => '1560000096000,47886' ) ), '5' => Array ( 'name' => 'VinaPhone', 'data' => Array ( '0' => '1559997553000,11132' ) ), '6' => Array ( 'name' => 'VNPT', 'data' => Array ( '0' => '1559993066000,84' ) ) ); $groupBy = []; foreach($a as $v){ array_key_exists($v['name'], $groupBy) ? array_push($groupBy[$v['name']]['data'], $v['data'][0]) : ($groupBy[$v['name']] = $v) ; } echo '<pre>'; print_r(array_values($groupBy));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 24
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 24
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 18
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/ASWDV
function name:  (null)
number of ops:  33
compiled vars:  !0 = $a, !1 = $groupBy, !2 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   75     1        ASSIGN                                                   !1, <array>
   76     2      > FE_RESET_R                                       $5      !0, ->24
          3    > > FE_FETCH_R                                               $5, !2, ->24
   77     4    >   FETCH_DIM_R                                      ~6      !2, 'name'
          5        ARRAY_KEY_EXISTS                                         ~6, !1
          6      > JMPZ                                                     ~7, ->18
   78     7    >   INIT_FCALL                                               'array_push'
          8        FETCH_DIM_R                                      ~8      !2, 'name'
          9        FETCH_DIM_W                                      $9      !1, ~8
         10        FETCH_DIM_W                                      $10     $9, 'data'
         11        SEND_REF                                                 $10
         12        FETCH_DIM_R                                      ~11     !2, 'data'
         13        FETCH_DIM_R                                      ~12     ~11, 0
         14        SEND_VAL                                                 ~12
         15        DO_ICALL                                         $13     
         16        QM_ASSIGN                                        ~14     $13
         17      > JMP                                                      ->22
   80    18    >   FETCH_DIM_R                                      ~15     !2, 'name'
         19        ASSIGN_DIM                                       ~16     !1, ~15
         20        OP_DATA                                                  !2
         21        QM_ASSIGN                                        ~14     ~16
         22    >   FREE                                                     ~14
   76    23      > JMP                                                      ->3
         24    >   FE_FREE                                                  $5
   83    25        ECHO                                                     '%3Cpre%3E'
   84    26        INIT_FCALL                                               'print_r'
         27        INIT_FCALL                                               'array_values'
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                         $17     
         30        SEND_VAR                                                 $17
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
122.6 ms | 1001 KiB | 16 Q