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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.58 ms | 1416 KiB | 21 Q