3v4l.org

run code in 300+ PHP versions simultaneously
<?php $begin = new DateTime('2020-12-01'); $end = new DateTime('2021-01-01'); $interval = new DateInterval('P1D'); $daterange = new DatePeriod($begin, $interval ,$end); $array = array(); foreach($daterange as $date){ if ($date->format('N') < 6) { $array[] = $date->format("D Y-m-d"); } } print_r($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 32
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 32
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 31
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 31
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/lCqFJ
function name:  (null)
number of ops:  37
compiled vars:  !0 = $begin, !1 = $end, !2 = $interval, !3 = $daterange, !4 = $array, !5 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $6      'DateTime'
          1        SEND_VAL_EX                                              '2020-12-01'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $6
    4     4        NEW                                              $9      'DateTime'
          5        SEND_VAL_EX                                              '2021-01-01'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $9
    6     8        NEW                                              $12     'DateInterval'
          9        SEND_VAL_EX                                              'P1D'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $12
    7    12        NEW                                              $15     'DatePeriod'
         13        SEND_VAR_EX                                              !0
         14        SEND_VAR_EX                                              !2
         15        SEND_VAR_EX                                              !1
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !3, $15
    8    18        ASSIGN                                                   !4, <array>
    9    19      > FE_RESET_R                                       $19     !3, ->32
         20    > > FE_FETCH_R                                               $19, !5, ->32
   10    21    >   INIT_METHOD_CALL                                         !5, 'format'
         22        SEND_VAL_EX                                              'N'
         23        DO_FCALL                                      0  $20     
         24        IS_SMALLER                                               $20, 6
         25      > JMPZ                                                     ~21, ->31
   11    26    >   INIT_METHOD_CALL                                         !5, 'format'
         27        SEND_VAL_EX                                              'D+Y-m-d'
         28        DO_FCALL                                      0  $23     
         29        ASSIGN_DIM                                               !4
         30        OP_DATA                                                  $23
    9    31    > > JMP                                                      ->20
         32    >   FE_FREE                                                  $19
   14    33        INIT_FCALL                                               'print_r'
         34        SEND_VAR                                                 !4
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.01 ms | 1006 KiB | 14 Q