3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dateMonth = '2013-08'; $dateFirstDay = new DateTime($dateMonth . '-01'); $dayOfWeekFirstDay = $dateFirstDay->foramt('w'); $nofDaysInMonth = $dateFirstDay->firmat('t'); $daysOfWeek = array( 0 => 'Sun', 1 => 'Mon', 2 => 'Tue', 3 => 'Wed', 4 => 'Thu', 5 => 'Fri', 6 => 'Sat' ); $currentDayOfWeek = $dayOfWeekFirstDay; foreach($daysOfWeek as $dayName) { echo $dayName . "\t"; } echo "\n"; if ($currentDayOfWeek != 1) { $skipFirstDays = (0 == $currentDayOfWeek ? 6 : $currentDayOfWeek-1); echo str_pad('', $skipFirstDays, " \t"); } for ($curDay = 1; $curDay <= $nofDaysInMonth; $curDay++, $currentDayOfWeek++) { if ($currentDayOfWeek == 7) { $currentDayOfWeek = 0; } $isWeekEnd = false; if ($currentDayOfWeek == 6 || $currentDayOfWeek == 0) { $isWeekEnd = true; } if (!$isWeekEnd) { echo $curDay . "\t"; } else { echo "[" . $curDay . "]\t"; } if ($currentDayOfWeek == 0) { echo "\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 21
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 38
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
2 jumps found. (Code = 44) Position 1 = 65, Position 2 = 40
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 43
Branch analysis from position: 42
2 jumps found. (Code = 47) Position 1 = 46, Position 2 = 48
Branch analysis from position: 46
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 50
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 55
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 61
Branch analysis from position: 60
2 jumps found. (Code = 44) Position 1 = 65, Position 2 = 40
Branch analysis from position: 65
Branch analysis from position: 40
Branch analysis from position: 61
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 61
Branch analysis from position: 60
Branch analysis from position: 61
Branch analysis from position: 50
Branch analysis from position: 48
Branch analysis from position: 43
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 38
Branch analysis from position: 21
filename:       /in/SUsvZ
function name:  (null)
number of ops:  66
compiled vars:  !0 = $dateMonth, !1 = $dateFirstDay, !2 = $dayOfWeekFirstDay, !3 = $nofDaysInMonth, !4 = $daysOfWeek, !5 = $currentDayOfWeek, !6 = $dayName, !7 = $skipFirstDays, !8 = $curDay, !9 = $isWeekEnd
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2013-08'
    5     1        NEW                                              $11     'DateTime'
          2        CONCAT                                           ~12     !0, '-01'
          3        SEND_VAL_EX                                              ~12
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $11
    6     6        INIT_METHOD_CALL                                         !1, 'foramt'
          7        SEND_VAL_EX                                              'w'
          8        DO_FCALL                                      0  $15     
          9        ASSIGN                                                   !2, $15
    8    10        INIT_METHOD_CALL                                         !1, 'firmat'
         11        SEND_VAL_EX                                              't'
         12        DO_FCALL                                      0  $17     
         13        ASSIGN                                                   !3, $17
   10    14        ASSIGN                                                   !4, <array>
   21    15        ASSIGN                                                   !5, !2
   23    16      > FE_RESET_R                                       $21     !4, ->21
         17    > > FE_FETCH_R                                               $21, !6, ->21
   24    18    >   CONCAT                                           ~22     !6, '%09'
         19        ECHO                                                     ~22
   23    20      > JMP                                                      ->17
         21    >   FE_FREE                                                  $21
   27    22        ECHO                                                     '%0A'
   30    23        IS_NOT_EQUAL                                             !5, 1
         24      > JMPZ                                                     ~23, ->38
   32    25    >   IS_EQUAL                                                 !5, 0
         26      > JMPZ                                                     ~24, ->29
         27    >   QM_ASSIGN                                        ~25     6
         28      > JMP                                                      ->31
         29    >   SUB                                              ~26     !5, 1
         30        QM_ASSIGN                                        ~25     ~26
         31    >   ASSIGN                                                   !7, ~25
   34    32        INIT_FCALL                                               'str_pad'
         33        SEND_VAL                                                 ''
         34        SEND_VAR                                                 !7
         35        SEND_VAL                                                 '+%09'
         36        DO_ICALL                                         $28     
         37        ECHO                                                     $28
   38    38    >   ASSIGN                                                   !8, 1
         39      > JMP                                                      ->63
   40    40    >   IS_EQUAL                                                 !5, 7
         41      > JMPZ                                                     ~30, ->43
   41    42    >   ASSIGN                                                   !5, 0
   45    43    >   ASSIGN                                                   !9, <false>
   46    44        IS_EQUAL                                         ~33     !5, 6
         45      > JMPNZ_EX                                         ~33     ~33, ->48
         46    >   IS_EQUAL                                         ~34     !5, 0
         47        BOOL                                             ~33     ~34
         48    > > JMPZ                                                     ~33, ->50
   47    49    >   ASSIGN                                                   !9, <true>
   51    50    >   BOOL_NOT                                         ~36     !9
         51      > JMPZ                                                     ~36, ->55
   52    52    >   CONCAT                                           ~37     !8, '%09'
         53        ECHO                                                     ~37
         54      > JMP                                                      ->58
   55    55    >   CONCAT                                           ~38     '%5B', !8
         56        CONCAT                                           ~39     ~38, '%5D%09'
         57        ECHO                                                     ~39
   58    58    >   IS_EQUAL                                                 !5, 0
         59      > JMPZ                                                     ~40, ->61
   59    60    >   ECHO                                                     '%0A'
   38    61    >   PRE_INC                                                  !8
         62        PRE_INC                                                  !5
         63    >   IS_SMALLER_OR_EQUAL                                      !8, !3
         64      > JMPNZ                                                    ~43, ->40
   62    65    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.83 ms | 1400 KiB | 15 Q