3v4l.org

run code in 300+ PHP versions simultaneously
<?php $months = array( "Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември" ); $days_in_month = array( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ); $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[$current_month_index]; $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 === 1) { ?> <?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 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 21
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 30
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
2 jumps found. (Code = 44) Position 1 = 69, Position 2 = 52
Branch analysis from position: 69
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 61
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 59, Position 2 = 60
Branch analysis from position: 59
2 jumps found. (Code = 44) Position 1 = 69, Position 2 = 52
Branch analysis from position: 69
Branch analysis from position: 52
Branch analysis from position: 60
Branch analysis from position: 61
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 30
Branch analysis from position: 38
Branch analysis from position: 30
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 21
Branch analysis from position: 28
Branch analysis from position: 21
filename:       /in/M91T4
function name:  (null)
number of ops:  71
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        ASSIGN                                                   !1, <array>
   12     2        INIT_FCALL                                               'date'
          3        SEND_VAL                                                 'n'
          4        DO_ICALL                                         $10     
          5        SUB                                              ~11     $10, 1
          6        ASSIGN                                                   !2, ~11
   14     7        INIT_FCALL                                               'date'
          8        SEND_VAL                                                 'j'
          9        DO_ICALL                                         $13     
         10        ASSIGN                                                   !3, $13
   15    11        INIT_FCALL                                               'date'
         12        SEND_VAL                                                 'w'
         13        DO_ICALL                                         $15     
         14        ASSIGN                                                   !4, $15
   16    15        MOD                                              ~17     !3, 7
         16        SUB                                              ~18     !4, ~17
         17        ASSIGN                                                   !5, ~18
   18    18        ASSIGN                                                   !6, <array>
   19    19        ASSIGN                                                   !7, 0
         20      > JMP                                                      ->26
   20    21    >   INIT_FCALL                                               'array_push'
         22        SEND_REF                                                 !6
         23        SEND_VAL                                                 ''
         24        DO_ICALL                                                 
   19    25        PRE_INC                                                  !7
         26    >   IS_SMALLER                                               !7, !5
         27      > JMPNZ                                                    ~24, ->21
   22    28    >   ASSIGN                                                   !7, 1
         29      > JMP                                                      ->35
   23    30    >   INIT_FCALL                                               'array_push'
         31        SEND_REF                                                 !6
         32        SEND_VAR                                                 !7
         33        DO_ICALL                                                 
   22    34        PRE_INC                                                  !7
         35    >   FETCH_DIM_R                                      ~28     !1, !2
         36        IS_SMALLER_OR_EQUAL                                      !7, ~28
         37      > JMPNZ                                                    ~29, ->30
   26    38    >   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'
   39    39        SUB                                              ~30     !2, 1
         40        FETCH_DIM_R                                      ~31     !0, ~30
         41        ECHO                                                     ~31
         42        ECHO                                                     '%3C%2Fa%3E%3C%2Ftd%3E%0A++++++++%3Ctd+colspan%3D%223%22%3E'
   40    43        FETCH_DIM_R                                      ~32     !0, !2
         44        ECHO                                                     ~32
         45        ECHO                                                     '%3C%2Ftd%3E%0A++++++++%3Ctd+colspan%3D%222%22%3E%3Ca+href%3D%22%23%22%3E'
   41    46        ADD                                              ~33     !2, 1
         47        FETCH_DIM_R                                      ~34     !0, ~33
         48        ECHO                                                     ~34
         49        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++++++'
   52    50        ASSIGN                                                   !7, 0
         51      > JMP                                                      ->66
   53    52    >   ECHO                                                     '++++++++'
         53        MOD                                              ~36     !7, 7
         54        IS_IDENTICAL                                             ~36, 1
         55      > JMPZ                                                     ~37, ->61
   54    56    >   ECHO                                                     '++++++++++'
         57        IS_NOT_EQUAL                                             !7, 1
         58      > JMPZ                                                     ~38, ->60
   55    59    >   ECHO                                                     '++++++++++++%3C%2Ftr%3E++++++++++++%0A++++++++++'
   57    60    >   ECHO                                                     '++%09++++++%3Ctr%3E%0A++++++++'
   59    61    >   ECHO                                                     '++++++++%3Ctd%3E'
         62        FETCH_DIM_R                                      ~39     !6, !7
         63        ECHO                                                     ~39
         64        ECHO                                                     '%3C%2Ftd%3E%0A++++++'
   52    65        PRE_INC                                                  !7
         66    >   COUNT                                            ~41     !6
         67        IS_SMALLER                                               !7, ~41
         68      > JMPNZ                                                    ~42, ->52
   61    69    >   ECHO                                                     '++++++%3C%2Ftr%3E%0A++++%3C%2Ftable%3E%0A++%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   64    70      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.38 ms | 1396 KiB | 17 Q