3v4l.org

run code in 500+ PHP versions simultaneously
<?php function channels_flatten(array $channels): array { $result = []; foreach ($channels as $channel) { foreach ($channel as $time => $show) { $result[$time][] = $show; } } ksort($result); return $result; } $input = [ [ '13:00' => '"Франциск" Драма 16+', '15:35' => '"Вы не оставите меня" Драма 16+', '07:00' => '"Мистер Штайн идет в онлайн" Комедия 16+', ], [ '13:00' => '"Василиса" Драма 12+', '07:00' => '"Последний король" Драма 16+', '15:35' => '"Капитан Фантастик" Драма 12+', ] ]; var_export(channels_flatten($input));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U5dib
function name:  (null)
number of ops:  8
compiled vars:  !0 = $input
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                       !0, <array>
   30     1        INIT_FCALL                                                   'var_export'
          2        INIT_FCALL                                                   'channels_flatten'
          3        SEND_VAR                                                     !0
          4        DO_FCALL                                          0  $2      
          5        SEND_VAR                                                     $2
          6        DO_ICALL                                                     
          7      > RETURN                                                       1

Function channels_flatten:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/U5dib
function name:  channels_flatten
number of ops:  21
compiled vars:  !0 = $channels, !1 = $result, !2 = $channel, !3 = $show, !4 = $time
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    5     1        ASSIGN                                                       !1, <array>
    6     2      > FE_RESET_R                                           $6      !0, ->13
          3    > > FE_FETCH_R                                                   $6, !2, ->13
    7     4    > > FE_RESET_R                                           $7      !2, ->11
          5    > > FE_FETCH_R                                           ~8      $7, !3, ->11
          6    >   ASSIGN                                                       !4, ~8
    8     7        FETCH_DIM_W                                          $10     !1, !4
          8        ASSIGN_DIM                                                   $10
          9        OP_DATA                                                      !3
    7    10      > JMP                                                          ->5
         11    >   FE_FREE                                                      $7
    6    12      > JMP                                                          ->3
         13    >   FE_FREE                                                      $6
   12    14        INIT_FCALL                                                   'ksort'
         15        SEND_REF                                                     !1
         16        DO_ICALL                                                     
   14    17        VERIFY_RETURN_TYPE                                           !1
         18      > RETURN                                                       !1
   15    19*       VERIFY_RETURN_TYPE                                           
         20*     > RETURN                                                       null

End of function channels_flatten

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.03 ms | 2350 KiB | 16 Q