3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isWeekend($date) { return $date->format('N') >= 6; } $periodStartDate = new \DateTime('today'); $periodStartDate = $periodStartDate->modify('-5 days'); $periodEndDate = new \DateTime('today'); $periodEndDate->modify('+1 day'); $period = new \DatePeriod($periodStartDate, \DateInterval::createFromDateString('1 day'), $periodEndDate); foreach ($period as $date) { echo $date->format('Y-m-d'); echo('<br>'); //if ($this->getDayOffInDaysOffByDate($daysOff, $date) || $this->isWeekend($date)) { // $daysCount--; //} }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 32
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 32
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/HRSrV
function name:  (null)
number of ops:  34
compiled vars:  !0 = $periodStartDate, !1 = $periodEndDate, !2 = $period, !3 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $4      'DateTime'
          1        SEND_VAL_EX                                              'today'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    8     4        INIT_METHOD_CALL                                         !0, 'modify'
          5        SEND_VAL_EX                                              '-5+days'
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !0, $7
    9     8        NEW                                              $9      'DateTime'
          9        SEND_VAL_EX                                              'today'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $9
   10    12        INIT_METHOD_CALL                                         !1, 'modify'
         13        SEND_VAL_EX                                              '%2B1+day'
         14        DO_FCALL                                      0          
   11    15        NEW                                              $13     'DatePeriod'
         16        SEND_VAR_EX                                              !0
         17        INIT_STATIC_METHOD_CALL                                  'DateInterval', 'createFromDateString'
         18        SEND_VAL                                                 '1+day'
         19        DO_FCALL                                      0  $14     
         20        SEND_VAR_NO_REF_EX                                       $14
         21        SEND_VAR_EX                                              !1
         22        DO_FCALL                                      0          
         23        ASSIGN                                                   !2, $13
   13    24      > FE_RESET_R                                       $17     !2, ->32
         25    > > FE_FETCH_R                                               $17, !3, ->32
   14    26    >   INIT_METHOD_CALL                                         !3, 'format'
         27        SEND_VAL_EX                                              'Y-m-d'
         28        DO_FCALL                                      0  $18     
         29        ECHO                                                     $18
   15    30        ECHO                                                     '%3Cbr%3E'
   13    31      > JMP                                                      ->25
         32    >   FE_FREE                                                  $17
   19    33      > RETURN                                                   1

Function isweekend:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HRSrV
function name:  isWeekend
number of ops:  7
compiled vars:  !0 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_METHOD_CALL                                         !0, 'format'
          2        SEND_VAL_EX                                              'N'
          3        DO_FCALL                                      0  $1      
          4        IS_SMALLER_OR_EQUAL                              ~2      6, $1
          5      > RETURN                                                   ~2
    5     6*     > RETURN                                                   null

End of function isweekend

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.06 ms | 1403 KiB | 13 Q