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; echo '$day: ' . $day ."\n"; $dateWeek = date("W", mktime(0, 0, 0, $month, $day, $year)); echo '$dateWeek: ' . $dateWeek ."\n"; if (intval(date("W")) > intval($dateWeek)) { echo "CONTINUE1\n"; 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(date("W", strtotime("+28 day"))) < intval(date("W"))) { $utolsoJelentkezhetoHet += 12; } echo "utolsoJelentkezhetoHet: " .$utolsoJelentkezhetoHet. "\n"; if (intval($dateWeek) > $utolsoJelentkezhetoHet) { $kellenekUresNapokAHonapVegen = false; echo "CONTINUE2\n"; 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 = 235
Branch analysis from position: 235
2 jumps found. (Code = 44) Position 1 = 239, Position 2 = 45
Branch analysis from position: 239
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 74, Position 2 = 76
Branch analysis from position: 74
1 jumps found. (Code = 42) Position 1 = 234
Branch analysis from position: 234
2 jumps found. (Code = 44) Position 1 = 239, Position 2 = 45
Branch analysis from position: 239
Branch analysis from position: 45
Branch analysis from position: 76
2 jumps found. (Code = 43) Position 1 = 99, Position 2 = 100
Branch analysis from position: 99
2 jumps found. (Code = 43) Position 1 = 106, Position 2 = 109
Branch analysis from position: 106
1 jumps found. (Code = 42) Position 1 = 234
Branch analysis from position: 234
Branch analysis from position: 109
2 jumps found. (Code = 43) Position 1 = 112, Position 2 = 113
Branch analysis from position: 112
2 jumps found. (Code = 43) Position 1 = 116, Position 2 = 118
Branch analysis from position: 116
1 jumps found. (Code = 42) Position 1 = 230
Branch analysis from position: 230
2 jumps found. (Code = 43) Position 1 = 233, Position 2 = 234
Branch analysis from position: 233
2 jumps found. (Code = 44) Position 1 = 239, Position 2 = 45
Branch analysis from position: 239
Branch analysis from position: 45
Branch analysis from position: 234
Branch analysis from position: 118
2 jumps found. (Code = 43) Position 1 = 122, Position 2 = 229
Branch analysis from position: 122
2 jumps found. (Code = 43) Position 1 = 140, Position 2 = 143
Branch analysis from position: 140
1 jumps found. (Code = 42) Position 1 = 144
Branch analysis from position: 144
2 jumps found. (Code = 43) Position 1 = 147, Position 2 = 190
Branch analysis from position: 147
2 jumps found. (Code = 43) Position 1 = 151, Position 2 = 164
Branch analysis from position: 151
1 jumps found. (Code = 42) Position 1 = 189
Branch analysis from position: 189
1 jumps found. (Code = 42) Position 1 = 228
Branch analysis from position: 228
1 jumps found. (Code = 42) Position 1 = 230
Branch analysis from position: 230
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 = 189
Branch analysis from position: 189
Branch analysis from position: 179
1 jumps found. (Code = 42) Position 1 = 228
Branch analysis from position: 228
Branch analysis from position: 190
2 jumps found. (Code = 43) Position 1 = 194, Position 2 = 205
Branch analysis from position: 194
1 jumps found. (Code = 42) Position 1 = 228
Branch analysis from position: 228
Branch analysis from position: 205
2 jumps found. (Code = 43) Position 1 = 212, Position 2 = 223
Branch analysis from position: 212
1 jumps found. (Code = 42) Position 1 = 226
Branch analysis from position: 226
1 jumps found. (Code = 42) Position 1 = 230
Branch analysis from position: 230
Branch analysis from position: 223
1 jumps found. (Code = 42) Position 1 = 230
Branch analysis from position: 230
Branch analysis from position: 143
2 jumps found. (Code = 43) Position 1 = 147, Position 2 = 190
Branch analysis from position: 147
Branch analysis from position: 190
Branch analysis from position: 229
2 jumps found. (Code = 43) Position 1 = 233, Position 2 = 234
Branch analysis from position: 233
Branch analysis from position: 234
Branch analysis from position: 113
Branch analysis from position: 100
filename:       /in/eXdIe
function name:  (null)
number of ops:  240
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                                                      ->235
   27    45    >   SUB                                              ~41     !9, !6
         46        ADD                                              ~42     ~41, 2
         47        ASSIGN                                                   !10, ~42
   28    48        CONCAT                                           ~44     '%24day%3A+', !10
         49        CONCAT                                           ~45     ~44, '%0A'
         50        ECHO                                                     ~45
   29    51        INIT_FCALL                                               'date'
         52        SEND_VAL                                                 'W'
         53        INIT_FCALL                                               'mktime'
         54        SEND_VAL                                                 0
         55        SEND_VAL                                                 0
         56        SEND_VAL                                                 0
         57        SEND_VAR                                                 !2
         58        SEND_VAR                                                 !10
         59        SEND_VAR                                                 !3
         60        DO_ICALL                                         $46     
         61        SEND_VAR                                                 $46
         62        DO_ICALL                                         $47     
         63        ASSIGN                                                   !11, $47
   30    64        CONCAT                                           ~49     '%24dateWeek%3A+', !11
         65        CONCAT                                           ~50     ~49, '%0A'
         66        ECHO                                                     ~50
   31    67        INIT_FCALL                                               'date'
         68        SEND_VAL                                                 'W'
         69        DO_ICALL                                         $51     
         70        CAST                                          4  ~52     $51
         71        CAST                                          4  ~53     !11
         72        IS_SMALLER                                               ~53, ~52
         73      > JMPZ                                                     ~54, ->76
   32    74    >   ECHO                                                     'CONTINUE1%0A'
   33    75      > JMP                                                      ->234
   36    76    >   INIT_FCALL                                               'date'
         77        SEND_VAL                                                 'W'
         78        INIT_FCALL                                               'strtotime'
         79        SEND_VAL                                                 '%2B+28+day'
         80        DO_ICALL                                         $55     
         81        SEND_VAR                                                 $55
         82        DO_ICALL                                         $56     
         83        CAST                                          4  ~57     $56
         84        ASSIGN                                                   !12, ~57
   37    85        INIT_FCALL                                               'date'
         86        SEND_VAL                                                 'W'
         87        INIT_FCALL                                               'strtotime'
         88        SEND_VAL                                                 '%2B28+day'
         89        DO_ICALL                                         $59     
         90        SEND_VAR                                                 $59
         91        DO_ICALL                                         $60     
         92        CAST                                          4  ~61     $60
         93        INIT_FCALL                                               'date'
         94        SEND_VAL                                                 'W'
         95        DO_ICALL                                         $62     
         96        CAST                                          4  ~63     $62
         97        IS_SMALLER                                               ~61, ~63
         98      > JMPZ                                                     ~64, ->100
   38    99    >   ASSIGN_OP                                     1          !12, 12
   40   100    >   CONCAT                                           ~66     'utolsoJelentkezhetoHet%3A+', !12
        101        CONCAT                                           ~67     ~66, '%0A'
        102        ECHO                                                     ~67
   41   103        CAST                                          4  ~68     !11
        104        IS_SMALLER                                               !12, ~68
        105      > JMPZ                                                     ~69, ->109
   42   106    >   ASSIGN                                                   !8, <false>
   43   107        ECHO                                                     'CONTINUE2%0A'
   44   108      > JMP                                                      ->234
   46   109    >   MOD                                              ~71     !9, 7
        110        IS_EQUAL                                                 ~71, 0
        111      > JMPZ                                                     ~72, ->113
   47   112    >   ECHO                                                     '%3Ctr%3E'
   49   113    >   SUB                                              ~73     !6, 1
        114        IS_SMALLER                                               !9, ~73
        115      > JMPZ                                                     ~74, ->118
   51   116    >   ECHO                                                     '%3Ctd+class%3D%27noborder%27%3E%3C%2Ftd%3E'
        117      > JMP                                                      ->230
   52   118    >   ADD                                              ~75     !7, !6
        119        SUB                                              ~76     ~75, 1
        120        IS_SMALLER                                               !9, ~76
        121      > JMPZ                                                     ~77, ->229
   54   122    >   SUB                                              ~78     !9, !6
        123        ADD                                              ~79     ~78, 2
        124        ASSIGN                                                   !10, ~79
   55   125        INIT_FCALL                                               'date'
        126        SEND_VAL                                                 'Y-m-d'
        127        INIT_FCALL                                               'mktime'
        128        SEND_VAL                                                 0
        129        SEND_VAL                                                 0
        130        SEND_VAL                                                 0
        131        SEND_VAR                                                 !2
        132        SEND_VAR                                                 !10
        133        SEND_VAR                                                 !3
        134        DO_ICALL                                         $81     
        135        SEND_VAR                                                 $81
        136        DO_ICALL                                         $82     
        137        ASSIGN                                                   !13, $82
   56   138        ISSET_ISEMPTY_DIM_OBJ                         0          !15, !13
        139      > JMPZ                                                     ~84, ->143
        140    >   FETCH_DIM_R                                      ~85     !15, !13
        141        QM_ASSIGN                                        ~86     ~85
        142      > JMP                                                      ->144
        143    >   QM_ASSIGN                                        ~86     0
        144    >   ASSIGN                                                   !14, ~86
   57   145        ISSET_ISEMPTY_DIM_OBJ                         0          !16, !13
        146      > JMPZ                                                     ~88, ->190
   58   147    >   INIT_FCALL_BY_NAME                                       'isDayInTheFuture'
        148        SEND_VAR_EX                                              !13
        149        DO_FCALL                                      0  $89     
        150      > JMPZ                                                     $89, ->164
   59   151    >   CONCAT                                           ~90     '%3Ctd+title%3D%27Klikkelj+a+lemond%C3%A1shoz%27+id%3D%27nap-', !13
        152        CONCAT                                           ~91     ~90, '%27+class%3D%27registered%27+onclick%3D%27lemondasMegerositese%28%22'
        153        CONCAT                                           ~92     ~91, !13
        154        CONCAT                                           ~93     ~92, '%22%29%27%3E%3Cspan+class%3D%27notToday%27%3E'
        155        CONCAT                                           ~94     ~93, !10
        156        CONCAT                                           ~95     ~94, '%3C%2Fspan%3E'
        157        INIT_FCALL_BY_NAME                                       'getNapiJelentkezokHtml'
        158        SEND_VAR_EX                                              !14
        159        DO_FCALL                                      0  $96     
        160        CONCAT                                           ~97     ~95, $96
        161        CONCAT                                           ~98     ~97, '%3C%2Ftd%3E'
        162        ECHO                                                     ~98
        163      > JMP                                                      ->189
   61   164    >   INIT_FCALL_BY_NAME                                       'isToday'
        165        SEND_VAR_EX                                              !13
        166        DO_FCALL                                      0  $99     
        167      > JMPZ                                                     $99, ->179
   62   168    >   CONCAT                                           ~100    '%3Ctd+id%3D%27nap-', !13
        169        CONCAT                                           ~101    ~100, '%27+class%3D%27todayRegistered+today%27%3E%3Cspan+class%3D%27today%27%3E'
        170        CONCAT                                           ~102    ~101, !10
        171        CONCAT                                           ~103    ~102, '%3C%2Fspan%3E'
        172        INIT_FCALL_BY_NAME                                       'getNapiJelentkezokHtml'
        173        SEND_VAR_EX                                              !14
        174        DO_FCALL                                      0  $104    
        175        CONCAT                                           ~105    ~103, $104
        176        CONCAT                                           ~106    ~105, '%3C%2Ftd%3E'
        177        ECHO                                                     ~106
        178      > JMP                                                      ->189
   64   179    >   CONCAT                                           ~107    '%3Ctd+id%3D%27nap-', !13
        180        CONCAT                                           ~108    ~107, '%27+class%3D%27pastRegistered%27%3E%3Cspan+class%3D%27notToday%27%3E'
        181        CONCAT                                           ~109    ~108, !10
        182        CONCAT                                           ~110    ~109, '%3C%2Fspan%3E'
        183        INIT_FCALL_BY_NAME                                       'getNapiJelentkezokHtml'
        184        SEND_VAR_EX                                              !14
        185        DO_FCALL                                      0  $111    
        186        CONCAT                                           ~112    ~110, $111
        187        CONCAT                                           ~113    ~112, '%3C%2Ftd%3E'
        188        ECHO                                                     ~113
        189    > > JMP                                                      ->228
   68   190    >   INIT_FCALL_BY_NAME                                       'isToday'
        191        SEND_VAR_EX                                              !13
        192        DO_FCALL                                      0  $114    
        193      > JMPZ                                                     $114, ->205
   69   194    >   CONCAT                                           ~115    '%3Ctd+id%3D%27nap-', !13
        195        CONCAT                                           ~116    ~115, '%27+class%3D%27notAvailableForRegistration+today%27%3E%3Cspan+class%3D%27today%27%3E'
        196        CONCAT                                           ~117    ~116, !10
        197        CONCAT                                           ~118    ~117, '%3C%2Fspan%3E'
        198        INIT_FCALL_BY_NAME                                       'getNapiJelentkezokHtml'
        199        SEND_VAR_EX                                              !14
        200        DO_FCALL                                      0  $119    
        201        CONCAT                                           ~120    ~118, $119
        202        CONCAT                                           ~121    ~120, '%3C%2Ftd%3E'
        203        ECHO                                                     ~121
        204      > JMP                                                      ->228
   71   205    >   CONCAT                                           ~122    '%3Ctd+title%3D%27Klikkelj+a+jelentkez%C3%A9shez%27+id%3D%27nap-', !13
        206        CONCAT                                           ~123    ~122, '%27+'
   72   207        INIT_FCALL_BY_NAME                                       'isDayAvailableForRegistration'
        208        SEND_VAR_EX                                              !13
        209        SEND_VAR_EX                                              !16
        210        DO_FCALL                                      0  $124    
        211      > JMPZ                                                     $124, ->223
   73   212    >   CONCAT                                           ~125    'class%3D%27availableForRegistration%27+onclick%3D%27jelentkezesMegerositese%28%22', !13
        213        CONCAT                                           ~126    ~125, '%22%29%27%3E%3Cspan+class%3D%27notToday%27%3E'
        214        CONCAT                                           ~127    ~126, !10
        215        CONCAT                                           ~128    ~127, '%3C%2Fspan%3E'
        216        INIT_FCALL_BY_NAME                                       'getNapiJelentkezokHtml'
        217        SEND_VAR_EX                                              !14
        218        DO_FCALL                                      0  $129    
        219        CONCAT                                           ~130    ~128, $129
        220        CONCAT                                           ~131    ~130, '%3C%2Ftd%3E'
        221        QM_ASSIGN                                        ~132    ~131
        222      > JMP                                                      ->226
   74   223    >   CONCAT                                           ~133    'class%3D%27notAvailableForRegistration%27%3E%3Cspan+class%3D%27notToday%27%3E', !10
        224        CONCAT                                           ~134    ~133, '%3C%2Fspan%3E%3C%2Ftd%3E'
        225        QM_ASSIGN                                        ~132    ~134
        226    >   CONCAT                                           ~135    ~123, ~132
        227        ECHO                                                     ~135
        228    > > JMP                                                      ->230
   79   229    >   ECHO                                                     '%3Ctd+class%3D%27noborder%27%3E%3C%2Ftd%3E'
   81   230    >   MOD                                              ~136    !9, 7
        231        IS_EQUAL                                                 ~136, 6
        232      > JMPZ                                                     ~137, ->234
   82   233    >   ECHO                                                     '%3C%2Ftr%3E'
   25   234    >   PRE_INC                                                  !9
        235    >   SUB                                              ~139    !6, 1
        236        ADD                                              ~140    !7, ~139
        237        IS_SMALLER                                               !9, ~140
        238      > JMPNZ                                                    ~141, ->45
   88   239    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.29 ms | 1420 KiB | 21 Q