3v4l.org

run code in 300+ 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 = 47
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 47
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 45, Position 2 = 21
Branch analysis from position: 45
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 = 45, Position 2 = 21
Branch analysis from position: 45
Branch analysis from position: 21
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
filename:       /in/4Iie8
function name:  (null)
number of ops:  50
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, ->47
         13    > > FE_FETCH_R                                       ~12     $11, !2, ->47
         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                                                      ->43
   29    21    >   INIT_FCALL                                               'printf'
   30    22        SEND_VAL                                                 '%3Ctd%3E%25s%3C%2Ftd%3E'
   31    23        INIT_FCALL                                               'implode'
   32    24        SEND_VAL                                                 '+to+'
   34    25        FETCH_DIM_IS                                     ~18     !2, !4
         26        COALESCE                                         ~19     ~18
         27        QM_ASSIGN                                        ~19     <array>
         28        CAST                                          7  ~20     ~19
         29        INIT_ARRAY                                       ~21     
         30        ADD_ARRAY_UNPACK                                 ~21     ~20
   35    31        FETCH_DIM_IS                                     ~22     !0, 'closing_time'
         32        FETCH_DIM_IS                                     ~23     ~22, !3
         33        FETCH_DIM_IS                                     ~24     ~23, !4
         34        COALESCE                                         ~25     ~24
         35        QM_ASSIGN                                        ~25     <array>
         36        CAST                                          7  ~26     ~25
         37        ADD_ARRAY_UNPACK                                 ~21     ~26
         38        SEND_VAL                                                 ~21
   31    39        DO_ICALL                                         $27     
   35    40        SEND_VAR                                                 $27
   29    41        DO_ICALL                                                 
   28    42        PRE_INC                                                  !4
         43    >   IS_SMALLER                                               !4, !1
         44      > JMPNZ                                                    ~30, ->21
   40    45    >   ECHO                                                     '%3C%2Ftr%3E%0A'
   26    46      > JMP                                                      ->13
         47    >   FE_FREE                                                  $11
   42    48        ECHO                                                     '%3C%2Ftable%3E'
         49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.42 ms | 1006 KiB | 17 Q