3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dateMonth = '2013-08'; $dateFirstDay = new DateTime($dateMonth . '-01'); $dayOfWeekFirstDay = $dateFirstDay->format('w'); $nofDaysInMonth = $dateFirstDay->format('t'); $daysOfWeek = array( 1 => 'Mon', 2 => 'Tue', 3 => 'Wed', 4 => 'Thu', 5 => 'Fri', 6 => 'Sat', 0 => 'Sun' ); $currentDayOfWeek = $dayOfWeekFirstDay; foreach($daysOfWeek as $dayName) { echo $dayName . "\t"; } echo "\n"; if ($currentDayOfWeek != 1) { $skipFirstDays = (0 == $currentDayOfWeek ? 6 : $currentDayOfWeek-1); echo str_pad('0', $skipFirstDays*2, " \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 = 39
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 = 64
Branch analysis from position: 64
2 jumps found. (Code = 44) Position 1 = 66, Position 2 = 41
Branch analysis from position: 66
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 44
Branch analysis from position: 43
2 jumps found. (Code = 47) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 51
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 56
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 62
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 66, Position 2 = 41
Branch analysis from position: 66
Branch analysis from position: 41
Branch analysis from position: 62
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 62
Branch analysis from position: 61
Branch analysis from position: 62
Branch analysis from position: 51
Branch analysis from position: 49
Branch analysis from position: 44
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 64
Branch analysis from position: 64
Branch analysis from position: 39
Branch analysis from position: 21
filename:       /in/cjutV
function name:  (null)
number of ops:  67
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, 'format'
          7        SEND_VAL_EX                                              'w'
          8        DO_FCALL                                      0  $15     
          9        ASSIGN                                                   !2, $15
    8    10        INIT_METHOD_CALL                                         !1, 'format'
         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, ->39
   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                                                 '0'
         34        MUL                                              ~28     !7, 2
         35        SEND_VAL                                                 ~28
         36        SEND_VAL                                                 '+%09'
         37        DO_ICALL                                         $29     
         38        ECHO                                                     $29
   38    39    >   ASSIGN                                                   !8, 1
         40      > JMP                                                      ->64
   40    41    >   IS_EQUAL                                                 !5, 7
         42      > JMPZ                                                     ~31, ->44
   41    43    >   ASSIGN                                                   !5, 0
   45    44    >   ASSIGN                                                   !9, <false>
   46    45        IS_EQUAL                                         ~34     !5, 6
         46      > JMPNZ_EX                                         ~34     ~34, ->49
         47    >   IS_EQUAL                                         ~35     !5, 0
         48        BOOL                                             ~34     ~35
         49    > > JMPZ                                                     ~34, ->51
   47    50    >   ASSIGN                                                   !9, <true>
   51    51    >   BOOL_NOT                                         ~37     !9
         52      > JMPZ                                                     ~37, ->56
   52    53    >   CONCAT                                           ~38     !8, '%09'
         54        ECHO                                                     ~38
         55      > JMP                                                      ->59
   55    56    >   CONCAT                                           ~39     '%5B', !8
         57        CONCAT                                           ~40     ~39, '%5D%09'
         58        ECHO                                                     ~40
   58    59    >   IS_EQUAL                                                 !5, 0
         60      > JMPZ                                                     ~41, ->62
   59    61    >   ECHO                                                     '%0A'
   38    62    >   PRE_INC                                                  !8
         63        PRE_INC                                                  !5
         64    >   IS_SMALLER_OR_EQUAL                                      !8, !3
         65      > JMPNZ                                                    ~44, ->41
   62    66    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.27 ms | 1400 KiB | 15 Q