3v4l.org

run code in 500+ PHP versions simultaneously
<?php $times = [ "opening_time" => [ "monday" => ["10:30 am", "6:30 pm"], "tuesday" => ["12:30 pm"], "wednesday" => ["4:30 pm"], "thursday" => ["2:30 pm"], "friday" => ["4:00 pm"], "saturday" => ["6:00 am"], "sunday" => [] ], "closing_time" => [ "monday" => ["6:00 pm", "10:30 pm"], "tuesday" => ["7:00 pm"], "wednesday" => ["10:00 pm"], "thursday" => ["6:30 pm"], "friday" => ["11:00 pm"], "saturday" => ["6:00 pm"], "sunday" => [] ] ]; $slots = max(array_map('count', $times['opening_time'])); echo '<table border=2 cell-padding=5>' ."\n"; foreach ($times['opening_time'] as $day => $opens) { echo "\t<tr><td>$day</td>"; for ($i = 0; $i < $slots; ++$i) { printf( '<td>%s</td>', implode( ' to ', [ ...(array) ($opens[$i] ?? []), ...(array) ($times['closing_time'][$day][$i] ?? []) ] ) ); } echo "</tr>\n"; } echo '</table>';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 44
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 44
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 21
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 21
Branch analysis from position: 42
Branch analysis from position: 21
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
filename:       /in/4Iie8
function name:  (null)
number of ops:  47
compiled vars:  !0 = $times, !1 = $slots, !2 = $opens, !3 = $day, !4 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   24     1        INIT_FCALL                                                   'max'
          2        INIT_FCALL                                                   'array_map'
          3        SEND_VAL                                                     'count'
          4        FETCH_DIM_R                                          ~6      !0, 'opening_time'
          5        SEND_VAL                                                     ~6
          6        DO_ICALL                                             $7      
          7        SEND_VAR                                                     $7
          8        DO_ICALL                                             $8      
          9        ASSIGN                                                       !1, $8
   25    10        ECHO                                                         '%3Ctable+border%3D2+cell-padding%3D5%3E%0A'
   26    11        FETCH_DIM_R                                          ~10     !0, 'opening_time'
         12      > FE_RESET_R                                           $11     ~10, ->44
         13    > > FE_FETCH_R                                           ~12     $11, !2, ->44
         14    >   ASSIGN                                                       !3, ~12
   27    15        ROPE_INIT                                         3  ~15     '%09%3Ctr%3E%3Ctd%3E'
         16        ROPE_ADD                                          1  ~15     ~15, !3
         17        ROPE_END                                          2  ~14     ~15, '%3C%2Ftd%3E'
         18        ECHO                                                         ~14
   28    19        ASSIGN                                                       !4, 0
         20      > JMP                                                          ->40
   29    21    >   INIT_FCALL                                                   'printf'
   30    22        SEND_VAL                                                     '%3Ctd%3E%25s%3C%2Ftd%3E'
   34    23        FETCH_DIM_IS                                         ~18     !2, !4
         24        COALESCE                                             ~19     ~18
         25        QM_ASSIGN                                            ~19     <array>
         26        CAST                                              7  ~20     ~19
         27        INIT_ARRAY                                           ~21     
         28        ADD_ARRAY_UNPACK                                     ~21     ~20
   35    29        FETCH_DIM_IS                                         ~22     !0, 'closing_time'
         30        FETCH_DIM_IS                                         ~23     ~22, !3
         31        FETCH_DIM_IS                                         ~24     ~23, !4
         32        COALESCE                                             ~25     ~24
   34    33        QM_ASSIGN                                            ~25     <array>
         34        CAST                                              7  ~26     ~25
         35        ADD_ARRAY_UNPACK                                     ~21     ~26
   31    36        FRAMELESS_ICALL_2                implode             ~27     '+to+', ~21
   34    37        SEND_VAL                                                     ~27
   29    38        DO_ICALL                                                     
   28    39        PRE_INC                                                      !4
         40    >   IS_SMALLER                                                   !4, !1
         41      > JMPNZ                                                        ~30, ->21
   40    42    >   ECHO                                                         '%3C%2Ftr%3E%0A'
   26    43      > JMP                                                          ->13
         44    >   FE_FREE                                                      $11
   42    45        ECHO                                                         '%3C%2Ftable%3E'
         46      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.67 ms | 1659 KiB | 17 Q