3v4l.org

run code in 300+ PHP versions simultaneously
<?php $currentMonth = date("n"); $currentYear = date("Y"); echo $currentMonth . "\n"; echo $currentYear . "\n"; $month = $currentMonth; $year = $currentYear; $firstDayOfTheMonth = mktime(0, 0, 0, $month, 1, $year); $d = getdate($firstDayOfTheMonth); // Vasarnap helyett hetfo az elso nap a heten. $dayOfTheWeekOfFirstDayOfTheMonth = (6 + $d["wday"]) % 7 + 1; $totalDaysInCurrentMonth = date("t"); $kellenekUresNapokAHonapVegen = true; echo $firstDayOfTheMonth . "firstDayOfTheMonth\n"; //echo $d . "d\n"; echo $dayOfTheWeekOfFirstDayOfTheMonth . "dayOfTheWeekOfFirstDayOfTheMonth\n"; echo $totalDaysInCurrentMonth . "totalDaysInCurrentMonth\n"; for ($i = 0; $i < $totalDaysInCurrentMonth + ($dayOfTheWeekOfFirstDayOfTheMonth - 1); $i++) { // Csak az aktuális héttől kezdve. Megjegyzés: date("W") hétfőt tekinti a hét első napjának, ami nekünk pont megfelel. $day = $i - $dayOfTheWeekOfFirstDayOfTheMonth + 2; $dateWeek = date("W", mktime(0, 0, 0, $month, $day, $year)); if (intval(date("W")) > intval($dateWeek)) { continue; } // A hónap végén azokat a heteket nem jelenítjük meg, amikre még nem lehetne jelentkezni. $utolsoJelentkezhetoHet = intval(date("W", strtotime("+ 28 day"))); if (intval($dateWeek) > $utolsoJelentkezhetoHet) { $kellenekUresNapokAHonapVegen = false; continue; } if ($i % 7 == 0) { echo "<tr>"; } if ($i < $dayOfTheWeekOfFirstDayOfTheMonth - 1) { // Ures napok a honap elejen. echo "<td class='noborder'></td>"; } else if ($i < $totalDaysInCurrentMonth + $dayOfTheWeekOfFirstDayOfTheMonth - 1){ // Naptari napok. $day = $i - $dayOfTheWeekOfFirstDayOfTheMonth + 2; $date = date("Y-m-d", mktime(0, 0, 0, $month, $day, $year)); $napiJelentkezok = isset($napiJelentkezokSzama[$date]) ? $napiJelentkezokSzama[$date] : 0; if (isset($jelentkezettNapok[$date])) { if (isDayInTheFuture($date)) { echo "<td title='Klikkelj a lemondáshoz' id='nap-".$date."' class='registered' onclick='lemondasMegerositese(\"".$date."\")'><span class='notToday'>".$day."</span>".getNapiJelentkezokHtml($napiJelentkezok)."</td>"; } else { if (isToday($date)) { echo "<td id='nap-".$date."' class='todayRegistered today'><span class='today'>".$day."</span>".getNapiJelentkezokHtml($napiJelentkezok)."</td>"; } else { echo "<td id='nap-".$date."' class='pastRegistered'><span class='notToday'>".$day."</span>".getNapiJelentkezokHtml($napiJelentkezok)."</td>"; } } } else { if (isToday($date)) { echo "<td id='nap-".$date."' class='notAvailableForRegistration today'><span class='today'>".$day."</span>".getNapiJelentkezokHtml($napiJelentkezok)."</td>"; } else { echo "<td title='Klikkelj a jelentkezéshez' id='nap-".$date."' " .(isDayAvailableForRegistration($date, $jelentkezettNapok) ? "class='availableForRegistration' onclick='jelentkezesMegerositese(\"".$date."\")'><span class='notToday'>".$day."</span>".getNapiJelentkezokHtml($napiJelentkezok)."</td>" : "class='notAvailableForRegistration'><span class='notToday'>".$day."</span></td>"); } } } else { // TODO(palinko): Kell ez? echo "<td class='noborder'></td>"; } if ($i % 7 == 6) { echo "</tr>"; } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 209
Branch analysis from position: 209
2 jumps found. (Code = 44) Position 1 = 213, Position 2 = 45
Branch analysis from position: 213
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 69
Branch analysis from position: 68
1 jumps found. (Code = 42) Position 1 = 208
Branch analysis from position: 208
2 jumps found. (Code = 44) Position 1 = 213, Position 2 = 45
Branch analysis from position: 213
Branch analysis from position: 45
Branch analysis from position: 69
2 jumps found. (Code = 43) Position 1 = 81, Position 2 = 83
Branch analysis from position: 81
1 jumps found. (Code = 42) Position 1 = 208
Branch analysis from position: 208
Branch analysis from position: 83
2 jumps found. (Code = 43) Position 1 = 86, Position 2 = 87
Branch analysis from position: 86
2 jumps found. (Code = 43) Position 1 = 90, Position 2 = 92
Branch analysis from position: 90
1 jumps found. (Code = 42) Position 1 = 204
Branch analysis from position: 204
2 jumps found. (Code = 43) Position 1 = 207, Position 2 = 208
Branch analysis from position: 207
2 jumps found. (Code = 44) Position 1 = 213, Position 2 = 45
Branch analysis from position: 213
Branch analysis from position: 45
Branch analysis from position: 208
Branch analysis from position: 92
2 jumps found. (Code = 43) Position 1 = 96, Position 2 = 203
Branch analysis from position: 96
2 jumps found. (Code = 43) Position 1 = 114, Position 2 = 117
Branch analysis from position: 114
1 jumps found. (Code = 42) Position 1 = 118
Branch analysis from position: 118
2 jumps found. (Code = 43) Position 1 = 121, Position 2 = 164
Branch analysis from position: 121
2 jumps found. (Code = 43) Position 1 = 125, Position 2 = 138
Branch analysis from position: 125
1 jumps found. (Code = 42) Position 1 = 163
Branch analysis from position: 163
1 jumps found. (Code = 42) Position 1 = 202
Branch analysis from position: 202
1 jumps found. (Code = 42) Position 1 = 204
Branch analysis from position: 204
Branch analysis from position: 138
2 jumps found. (Code = 43) Position 1 = 142, Position 2 = 153
Branch analysis from position: 142
1 jumps found. (Code = 42) Position 1 = 163
Branch analysis from position: 163
Branch analysis from position: 153
1 jumps found. (Code = 42) Position 1 = 202
Branch analysis from position: 202
Branch analysis from position: 164
2 jumps found. (Code = 43) Position 1 = 168, Position 2 = 179
Branch analysis from position: 168
1 jumps found. (Code = 42) Position 1 = 202
Branch analysis from position: 202
Branch analysis from position: 179
2 jumps found. (Code = 43) Position 1 = 186, Position 2 = 197
Branch analysis from position: 186
1 jumps found. (Code = 42) Position 1 = 200
Branch analysis from position: 200
1 jumps found. (Code = 42) Position 1 = 204
Branch analysis from position: 204
Branch analysis from position: 197
1 jumps found. (Code = 42) Position 1 = 204
Branch analysis from position: 204
Branch analysis from position: 117
2 jumps found. (Code = 43) Position 1 = 121, Position 2 = 164
Branch analysis from position: 121
Branch analysis from position: 164
Branch analysis from position: 203
2 jumps found. (Code = 43) Position 1 = 207, Position 2 = 208
Branch analysis from position: 207
Branch analysis from position: 208
Branch analysis from position: 87
filename:       /in/S9aGR
function name:  (null)
number of ops:  214
compiled vars:  !0 = $currentMonth, !1 = $currentYear, !2 = $month, !3 = $year, !4 = $firstDayOfTheMonth, !5 = $d, !6 = $dayOfTheWeekOfFirstDayOfTheMonth, !7 = $totalDaysInCurrentMonth, !8 = $kellenekUresNapokAHonapVegen, !9 = $i, !10 = $day, !11 = $dateWeek, !12 = $utolsoJelentkezhetoHet, !13 = $date, !14 = $napiJelentkezok, !15 = $napiJelentkezokSzama, !16 = $jelentkezettNapok
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'date'
          1        SEND_VAL                                                 'n'
          2        DO_ICALL                                         $17     
          3        ASSIGN                                                   !0, $17
    3     4        INIT_FCALL                                               'date'
          5        SEND_VAL                                                 'Y'
          6        DO_ICALL                                         $19     
          7        ASSIGN                                                   !1, $19
    4     8        CONCAT                                           ~21     !0, '%0A'
          9        ECHO                                                     ~21
    5    10        CONCAT                                           ~22     !1, '%0A'
         11        ECHO                                                     ~22
    7    12        ASSIGN                                                   !2, !0
    8    13        ASSIGN                                                   !3, !1
   10    14        INIT_FCALL                                               'mktime'
         15        SEND_VAL                                                 0
         16        SEND_VAL                                                 0
         17        SEND_VAL                                                 0
         18        SEND_VAR                                                 !2
         19        SEND_VAL                                                 1
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                         $25     
         22        ASSIGN                                                   !4, $25
   11    23        INIT_FCALL                                               'getdate'
         24        SEND_VAR                                                 !4
         25        DO_ICALL                                         $27     
         26        ASSIGN                                                   !5, $27
   13    27        FETCH_DIM_R                                      ~29     !5, 'wday'
         28        ADD                                              ~30     6, ~29
         29        MOD                                              ~31     ~30, 7
         30        ADD                                              ~32     ~31, 1
         31        ASSIGN                                                   !6, ~32
   14    32        INIT_FCALL                                               'date'
         33        SEND_VAL                                                 't'
         34        DO_ICALL                                         $34     
         35        ASSIGN                                                   !7, $34
   15    36        ASSIGN                                                   !8, <true>
   17    37        CONCAT                                           ~37     !4, 'firstDayOfTheMonth%0A'
         38        ECHO                                                     ~37
   19    39        CONCAT                                           ~38     !6, 'dayOfTheWeekOfFirstDayOfTheMonth%0A'
         40        ECHO                                                     ~38
   20    41        CONCAT                                           ~39     !7, 'totalDaysInCurrentMonth%0A'
         42        ECHO                                                     ~39
   25    43        ASSIGN                                                   !9, 0
         44      > JMP                                                      ->209
   27    45    >   SUB                                              ~41     !9, !6
         46        ADD                                              ~42     ~41, 2
         47        ASSIGN                                                   !10, ~42
   28    48        INIT_FCALL                                               'date'
         49        SEND_VAL                                                 'W'
         50        INIT_FCALL                                               'mktime'
         51        SEND_VAL                                                 0
         52        SEND_VAL                                                 0
         53        SEND_VAL                                                 0
         54        SEND_VAR                                                 !2
         55        SEND_VAR                                                 !10
         56        SEND_VAR                                                 !3
         57        DO_ICALL                                         $44     
         58        SEND_VAR                                                 $44
         59        DO_ICALL                                         $45     
         60        ASSIGN                                                   !11, $45
   29    61        INIT_FCALL                                               'date'
         62        SEND_VAL                                                 'W'
         63        DO_ICALL                                         $47     
         64        CAST                                          4  ~48     $47
         65        CAST                                          4  ~49     !11
         66        IS_SMALLER                                               ~49, ~48
         67      > JMPZ                                                     ~50, ->69
   30    68    > > JMP                                                      ->208
   33    69    >   INIT_FCALL                                               'date'
         70        SEND_VAL                                                 'W'
         71        INIT_FCALL                                               'strtotime'
         72        SEND_VAL                                                 '%2B+28+day'
         73        DO_ICALL                                         $51     
         74        SEND_VAR                                                 $51
         75        DO_ICALL                                         $52     
         76        CAST                                          4  ~53     $52
         77        ASSIGN                                                   !12, ~53
   34    78        CAST                                          4  ~55     !11
         79        IS_SMALLER                                               !12, ~55
         80      > JMPZ                                                     ~56, ->83
   35    81    >   ASSIGN                                                   !8, <false>
   36    82      > JMP                                                      ->208
   38    83    >   MOD                                              ~58     !9, 7
         84        IS_EQUAL                                                 ~58, 0
         85      > JMPZ                                                     ~59, ->87
   39    86    >   ECHO                                                     '%3Ctr%3E'
   41    87    >   SUB                                              ~60     !6, 1
         88        IS_SMALLER                                               !9, ~60
         89      > JMPZ                                                     ~61, ->92
   43    90    >   ECHO                                                     '%3Ctd+class%3D%27noborder%27%3E%3C%2Ftd%3E'
         91      > JMP                                                      ->204
   44    92    >   ADD                                              ~62     !7, !6
         93        SUB                                              ~63     ~62, 1
         94        IS_SMALLER                                               !9, ~63
         95      > JMPZ                                                     ~64, ->203
   46    96    >   SUB                                              ~65     !9, !6
         97        ADD                                              ~66     ~65, 2
         98        ASSIGN                                                   !10, ~66
   47    99        INIT_FCALL                                               'date'
        100        SEND_VAL                                                 'Y-m-d'
        101        INIT_FCALL                                               'mktime'
        102        SEND_VAL                                                 0
        103        SEND_VAL                                                 0
        104        SEND_VAL                                                 0
        105        SEND_VAR                                                 !2
        106        SEND_VAR                                                 !10
        107        SEND_VAR                                                 !3
        108        DO_ICALL                                         $68     
        109        SEND_VAR                                                 $68
        110        DO_ICALL                                         $69     
        111        ASSIGN                                                   !13, $69
   48   112        ISSET_ISEMPTY_DIM_OBJ                         0          !15, !13
        113      > JMPZ                                                     ~71, ->117
        114    >   FETCH_DIM_R                                      ~72     !15, !13
        115        QM_ASSIGN                                        ~73     ~72
        116      > JMP                                                      ->118
        117    >   QM_ASSIGN                                        ~73     0
        118    >   ASSIGN                                                   !14, ~73
   49   119        ISSET_ISEMPTY_DIM_OBJ                         0          !16, !13
        120      > JMPZ                                                     ~75, ->164
   50   121    >   INIT_FCALL_BY_NAME                                       'isDayInTheFuture'
        122        SEND_VAR_EX                                              !13
        123        DO_FCALL                                      0  $76     
        124      > JMPZ                                                     $76, ->138
   51   125    >   CONCAT                                           ~77     '%3Ctd+title%3D%27Klikkelj+a+lemond%C3%A1shoz%27+id%3D%27nap-', !13
        126        CONCAT                                           ~78     ~77, '%27+class%3D%27registered%27+onclick%3D%27lemondasMegerositese%28%22'
        127        CONCAT                                           ~79     ~78, !13
        128        CONCAT                                           ~80     ~79, '%22%29%27%3E%3Cspan+class%3D%27notToday%27%3E'
        129        CONCAT                                           ~81     ~80, !10
        130        CONCAT                                           ~82     ~81, '%3C%2Fspan%3E'
        131        INIT_FCALL_BY_NAME                                       'getNapiJelentkezokHtml'
        132        SEND_VAR_EX                                              !14
        133        DO_FCALL                                      0  $83     
        134        CONCAT                                           ~84     ~82, $83
        135        CONCAT                                           ~85     ~84, '%3C%2Ftd%3E'
        136        ECHO                                                     ~85
        137      > JMP                                                      ->163
   53   138    >   INIT_FCALL_BY_NAME                                       'isToday'
        139        SEND_VAR_EX                                              !13
        140        DO_FCALL                                      0  $86     
        141      > JMPZ                                                     $86, ->153
   54   142    >   CONCAT                                           ~87     '%3Ctd+id%3D%27nap-', !13
        143        CONCAT                                           ~88     ~87, '%27+class%3D%27todayRegistered+today%27%3E%3Cspan+class%3D%27today%27%3E'
        144        CONCAT                                           ~89     ~88, !10
        145        CONCAT                                           ~90     ~89, '%3C%2Fspan%3E'
        146        INIT_FCALL_BY_NAME                                       'getNapiJelentkezokHtml'
        147        SEND_VAR_EX                                              !14
        148        DO_FCALL                                      0  $91     
        149        CONCAT                                           ~92     ~90, $91
        150        CONCAT                                           ~93     ~92, '%3C%2Ftd%3E'
        151        ECHO                                                     ~93
        152      > JMP                                                      ->163
   56   153    >   CONCAT                                           ~94     '%3Ctd+id%3D%27nap-', !13
        154        CONCAT                                           ~95     ~94, '%27+class%3D%27pastRegistered%27%3E%3Cspan+class%3D%27notToday%27%3E'
        155        CONCAT                                           ~96     ~95, !10
        156        CONCAT                                           ~97     ~96, '%3C%2Fspan%3E'
        157        INIT_FCALL_BY_NAME                                       'getNapiJelentkezokHtml'
        158        SEND_VAR_EX                                              !14
        159        DO_FCALL                                      0  $98     
        160        CONCAT                                           ~99     ~97, $98
        161        CONCAT                                           ~100    ~99, '%3C%2Ftd%3E'
        162        ECHO                                                     ~100
        163    > > JMP                                                      ->202
   60   164    >   INIT_FCALL_BY_NAME                                       'isToday'
        165        SEND_VAR_EX                                              !13
        166        DO_FCALL                                      0  $101    
        167      > JMPZ                                                     $101, ->179
   61   168    >   CONCAT                                           ~102    '%3Ctd+id%3D%27nap-', !13
        169        CONCAT                                           ~103    ~102, '%27+class%3D%27notAvailableForRegistration+today%27%3E%3Cspan+class%3D%27today%27%3E'
        170        CONCAT                                           ~104    ~103, !10
        171        CONCAT                                           ~105    ~104, '%3C%2Fspan%3E'
        172        INIT_FCALL_BY_NAME                                       'getNapiJelentkezokHtml'
        173        SEND_VAR_EX                                              !14
        174        DO_FCALL                                      0  $106    
        175        CONCAT                                           ~107    ~105, $106
        176        CONCAT                                           ~108    ~107, '%3C%2Ftd%3E'
        177        ECHO                                                     ~108
        178      > JMP                                                      ->202
   63   179    >   CONCAT                                           ~109    '%3Ctd+title%3D%27Klikkelj+a+jelentkez%C3%A9shez%27+id%3D%27nap-', !13
        180        CONCAT                                           ~110    ~109, '%27+'
   64   181        INIT_FCALL_BY_NAME                                       'isDayAvailableForRegistration'
        182        SEND_VAR_EX                                              !13
        183        SEND_VAR_EX                                              !16
        184        DO_FCALL                                      0  $111    
        185      > JMPZ                                                     $111, ->197
   65   186    >   CONCAT                                           ~112    'class%3D%27availableForRegistration%27+onclick%3D%27jelentkezesMegerositese%28%22', !13
        187        CONCAT                                           ~113    ~112, '%22%29%27%3E%3Cspan+class%3D%27notToday%27%3E'
        188        CONCAT                                           ~114    ~113, !10
        189        CONCAT                                           ~115    ~114, '%3C%2Fspan%3E'
        190        INIT_FCALL_BY_NAME                                       'getNapiJelentkezokHtml'
        191        SEND_VAR_EX                                              !14
        192        DO_FCALL                                      0  $116    
        193        CONCAT                                           ~117    ~115, $116
        194        CONCAT                                           ~118    ~117, '%3C%2Ftd%3E'
        195        QM_ASSIGN                                        ~119    ~118
        196      > JMP                                                      ->200
   66   197    >   CONCAT                                           ~120    'class%3D%27notAvailableForRegistration%27%3E%3Cspan+class%3D%27notToday%27%3E', !10
        198        CONCAT                                           ~121    ~120, '%3C%2Fspan%3E%3C%2Ftd%3E'
        199        QM_ASSIGN                                        ~119    ~121
        200    >   CONCAT                                           ~122    ~110, ~119
        201        ECHO                                                     ~122
        202    > > JMP                                                      ->204
   71   203    >   ECHO                                                     '%3Ctd+class%3D%27noborder%27%3E%3C%2Ftd%3E'
   73   204    >   MOD                                              ~123    !9, 7
        205        IS_EQUAL                                                 ~123, 6
        206      > JMPZ                                                     ~124, ->208
   74   207    >   ECHO                                                     '%3C%2Ftr%3E'
   25   208    >   PRE_INC                                                  !9
        209    >   SUB                                              ~126    !6, 1
        210        ADD                                              ~127    !7, ~126
        211        IS_SMALLER                                               !9, ~127
        212      > JMPNZ                                                    ~128, ->45
   80   213    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.09 ms | 1416 KiB | 21 Q