3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array ( 0 => array ( 'N_127y4Gral' => array ( 0 => '302', ), ), 1 => array ( 'N_127y4Gral' => array ( 0 => '288', ), ), 2 => array ( 'N_144y4Gral' => array ( 0 => '317', ), ), 3 => array ( 'N_144y4Gral' => array ( 0 => '307', ), ), 4 => array ( 'N_144y4Gral' => array ( 0 => '332', ), )); foreach($arr as $sub){ foreach($sub as $key => $val){ $res[$key][] = $val[0]; if(!isset($count[$key])){ $count[$key] = 1; }else{ $count[$key]++; } } } $max = max($count); foreach($res as &$subarray){ $subarray = array_merge($subarray, array_fill(0,$max-count($subarray), 0)); } var_dump($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 21
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 19
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 19
Branch analysis from position: 21
2 jumps found. (Code = 125) Position 1 = 27, Position 2 = 41
Branch analysis from position: 27
2 jumps found. (Code = 126) Position 1 = 28, Position 2 = 41
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
Branch analysis from position: 21
filename:       /in/WHWYg
function name:  (null)
number of ops:  46
compiled vars:  !0 = $arr, !1 = $sub, !2 = $val, !3 = $key, !4 = $res, !5 = $count, !6 = $max, !7 = $subarray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   41     1      > FE_RESET_R                                       $9      !0, ->21
          2    > > FE_FETCH_R                                               $9, !1, ->21
   42     3    > > FE_RESET_R                                       $10     !1, ->19
          4    > > FE_FETCH_R                                       ~11     $10, !2, ->19
          5    >   ASSIGN                                                   !3, ~11
   43     6        FETCH_DIM_R                                      ~15     !2, 0
          7        FETCH_DIM_W                                      $13     !4, !3
          8        ASSIGN_DIM                                               $13
          9        OP_DATA                                                  ~15
   44    10        ISSET_ISEMPTY_DIM_OBJ                         0  ~16     !5, !3
         11        BOOL_NOT                                         ~17     ~16
         12      > JMPZ                                                     ~17, ->16
   45    13    >   ASSIGN_DIM                                               !5, !3
         14        OP_DATA                                                  1
         15      > JMP                                                      ->18
   47    16    >   FETCH_DIM_RW                                     $19     !5, !3
         17        PRE_INC                                                  $19
   42    18    > > JMP                                                      ->4
         19    >   FE_FREE                                                  $10
   41    20      > JMP                                                      ->2
         21    >   FE_FREE                                                  $9
   51    22        INIT_FCALL                                               'max'
         23        SEND_VAR                                                 !5
         24        DO_ICALL                                         $21     
         25        ASSIGN                                                   !6, $21
   52    26      > FE_RESET_RW                                      $23     !4, ->41
         27    > > FE_FETCH_RW                                              $23, !7, ->41
   53    28    >   INIT_FCALL                                               'array_merge'
         29        SEND_VAR                                                 !7
         30        INIT_FCALL                                               'array_fill'
         31        SEND_VAL                                                 0
         32        COUNT                                            ~24     !7
         33        SUB                                              ~25     !6, ~24
         34        SEND_VAL                                                 ~25
         35        SEND_VAL                                                 0
         36        DO_ICALL                                         $26     
         37        SEND_VAR                                                 $26
         38        DO_ICALL                                         $27     
         39        ASSIGN                                                   !7, $27
   52    40      > JMP                                                      ->27
         41    >   FE_FREE                                                  $23
   55    42        INIT_FCALL                                               'var_dump'
         43        SEND_VAR                                                 !4
         44        DO_ICALL                                                 
         45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.14 ms | 1405 KiB | 21 Q