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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.52 ms | 1416 KiB | 21 Q