3v4l.org

run code in 300+ PHP versions simultaneously
<?php $months = array( "Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември" ); $days_in_month = date('t'); $current_month_index = date("n") - 1; $day_of_the_month = date("j"); $day_of_the_week = date("w"); $day_of_the_week_difference = $day_of_the_week - ($day_of_the_month % 7); $elements_in_calendar = array(); for ($i = 0; $i < $day_of_the_week_difference; $i++) { array_push($elements_in_calendar, ""); } for ($i = 1; $i <= $days_in_month; $i++) { array_push($elements_in_calendar, $i); } ?> <html> <head> <style> table, td { border: 1px solid #000; text-align: center; border-collapse: collapse; } </style> </head> <body> <table> <tr> <td colspan="2"><a href="#"><?php echo $months[$current_month_index - 1] ?></a></td> <td colspan="3"><?php echo $months[$current_month_index] ?></td> <td colspan="2"><a href="#"><?php echo $months[$current_month_index + 1] ?></a></td> </tr> <tr> <td>Понеделник</td> <td>Вторник</td> <td>Сряда</td> <td>Четвъртък</td> <td>Петък</td> <td>Събота</td> <td>Неделя</td> </tr> <?php for ($i = 0; $i < count($elements_in_calendar); $i++) { ?> <?php if ($i % 7 === 0) { ?> <?php if ($i != 1) { ?> </tr> <?php } ?> <tr> <?php } ?> <td><?php echo $elements_in_calendar[$i] ?></td> <?php } ?> </tr> </table> </body> </html>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 24
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 33
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
2 jumps found. (Code = 44) Position 1 = 71, Position 2 = 54
Branch analysis from position: 71
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 54
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 63
Branch analysis from position: 58
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 62
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 71, Position 2 = 54
Branch analysis from position: 71
Branch analysis from position: 54
Branch analysis from position: 62
Branch analysis from position: 63
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 33
Branch analysis from position: 40
Branch analysis from position: 33
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 24
Branch analysis from position: 31
Branch analysis from position: 24
filename:       /in/sdrSq
function name:  (null)
number of ops:  73
compiled vars:  !0 = $months, !1 = $days_in_month, !2 = $current_month_index, !3 = $day_of_the_month, !4 = $day_of_the_week, !5 = $day_of_the_week_difference, !6 = $elements_in_calendar, !7 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'date'
          2        SEND_VAL                                                 't'
          3        DO_ICALL                                         $9      
          4        ASSIGN                                                   !1, $9
   10     5        INIT_FCALL                                               'date'
          6        SEND_VAL                                                 'n'
          7        DO_ICALL                                         $11     
          8        SUB                                              ~12     $11, 1
          9        ASSIGN                                                   !2, ~12
   12    10        INIT_FCALL                                               'date'
         11        SEND_VAL                                                 'j'
         12        DO_ICALL                                         $14     
         13        ASSIGN                                                   !3, $14
   13    14        INIT_FCALL                                               'date'
         15        SEND_VAL                                                 'w'
         16        DO_ICALL                                         $16     
         17        ASSIGN                                                   !4, $16
   14    18        MOD                                              ~18     !3, 7
         19        SUB                                              ~19     !4, ~18
         20        ASSIGN                                                   !5, ~19
   16    21        ASSIGN                                                   !6, <array>
   17    22        ASSIGN                                                   !7, 0
         23      > JMP                                                      ->29
   18    24    >   INIT_FCALL                                               'array_push'
         25        SEND_REF                                                 !6
         26        SEND_VAL                                                 ''
         27        DO_ICALL                                                 
   17    28        PRE_INC                                                  !7
         29    >   IS_SMALLER                                               !7, !5
         30      > JMPNZ                                                    ~25, ->24
   20    31    >   ASSIGN                                                   !7, 1
         32      > JMP                                                      ->38
   21    33    >   INIT_FCALL                                               'array_push'
         34        SEND_REF                                                 !6
         35        SEND_VAR                                                 !7
         36        DO_ICALL                                                 
   20    37        PRE_INC                                                  !7
         38    >   IS_SMALLER_OR_EQUAL                                      !7, !1
         39      > JMPNZ                                                    ~29, ->33
   24    40    >   ECHO                                                     '%3Chtml%3E%0A++%3Chead%3E%0A++++%3Cstyle%3E%0A++++++table%2C+td+%7B%0A++++++++border%3A+1px+solid+%23000%3B%0A++++++++text-align%3A+center%3B%0A++++++++border-collapse%3A+collapse%3B%0A++++++%7D%0A++++%3C%2Fstyle%3E%0A++%3C%2Fhead%3E%0A++%3Cbody%3E%0A++++%3Ctable%3E%0A++++++%3Ctr%3E%0A++++++++%3Ctd+colspan%3D%222%22%3E%3Ca+href%3D%22%23%22%3E'
   37    41        SUB                                              ~30     !2, 1
         42        FETCH_DIM_R                                      ~31     !0, ~30
         43        ECHO                                                     ~31
         44        ECHO                                                     '%3C%2Fa%3E%3C%2Ftd%3E%0A++++++++%3Ctd+colspan%3D%223%22%3E'
   38    45        FETCH_DIM_R                                      ~32     !0, !2
         46        ECHO                                                     ~32
         47        ECHO                                                     '%3C%2Ftd%3E%0A++++++++%3Ctd+colspan%3D%222%22%3E%3Ca+href%3D%22%23%22%3E'
   39    48        ADD                                              ~33     !2, 1
         49        FETCH_DIM_R                                      ~34     !0, ~33
         50        ECHO                                                     ~34
         51        ECHO                                                     '%3C%2Fa%3E%3C%2Ftd%3E%0A++++++%3C%2Ftr%3E%0A++++++%3Ctr%3E%0A++++++++%3Ctd%3E%D0%9F%D0%BE%D0%BD%D0%B5%D0%B4%D0%B5%D0%BB%D0%BD%D0%B8%D0%BA%3C%2Ftd%3E%0A++++++++%3Ctd%3E%D0%92%D1%82%D0%BE%D1%80%D0%BD%D0%B8%D0%BA%3C%2Ftd%3E%0A++++++++%3Ctd%3E%D0%A1%D1%80%D1%8F%D0%B4%D0%B0%3C%2Ftd%3E%0A++++++++%3Ctd%3E%D0%A7%D0%B5%D1%82%D0%B2%D1%8A%D1%80%D1%82%D1%8A%D0%BA%3C%2Ftd%3E%0A++++++++%3Ctd%3E%D0%9F%D0%B5%D1%82%D1%8A%D0%BA%3C%2Ftd%3E%0A++++++++%3Ctd%3E%D0%A1%D1%8A%D0%B1%D0%BE%D1%82%D0%B0%3C%2Ftd%3E%0A++++++++%3Ctd%3E%D0%9D%D0%B5%D0%B4%D0%B5%D0%BB%D1%8F%3C%2Ftd%3E%0A++++++%3C%2Ftr%3E%0A++++++'
   50    52        ASSIGN                                                   !7, 0
         53      > JMP                                                      ->68
   51    54    >   ECHO                                                     '++++++++'
         55        MOD                                              ~36     !7, 7
         56        IS_IDENTICAL                                             ~36, 0
         57      > JMPZ                                                     ~37, ->63
   52    58    >   ECHO                                                     '++++++++++'
         59        IS_NOT_EQUAL                                             !7, 1
         60      > JMPZ                                                     ~38, ->62
   53    61    >   ECHO                                                     '++++++++++++%3C%2Ftr%3E++++++++++++%0A++++++++++'
   55    62    >   ECHO                                                     '++%09++++++%3Ctr%3E%0A++++++++'
   57    63    >   ECHO                                                     '++++++++%3Ctd%3E'
         64        FETCH_DIM_R                                      ~39     !6, !7
         65        ECHO                                                     ~39
         66        ECHO                                                     '%3C%2Ftd%3E%0A++++++'
   50    67        PRE_INC                                                  !7
         68    >   COUNT                                            ~41     !6
         69        IS_SMALLER                                               !7, ~41
         70      > JMPNZ                                                    ~42, ->54
   59    71    >   ECHO                                                     '++++++%3C%2Ftr%3E%0A++++%3C%2Ftable%3E%0A++%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   62    72      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.42 ms | 1404 KiB | 17 Q