3v4l.org

run code in 300+ PHP versions simultaneously
<?php $no = 0; $start = new DateTime('2022-09-01'); $end = new DateTime('2022-09-19'); $interval = DateInterval::createFromDateString('1 day'); $period = new DatePeriod($start, $interval, $end); print_r($period); foreach ($period as $dt) { if ($dt->format('N') == 7) { $no++; } } echo $no;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 31
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 31
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 30
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 30
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/ZX00UI
function name:  (null)
number of ops:  34
compiled vars:  !0 = $no, !1 = $start, !2 = $end, !3 = $interval, !4 = $period, !5 = $dt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 0
    3     1        NEW                                              $7      'DateTime'
          2        SEND_VAL_EX                                              '2022-09-01'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $7
    4     5        NEW                                              $10     'DateTime'
          6        SEND_VAL_EX                                              '2022-09-19'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $10
    5     9        INIT_STATIC_METHOD_CALL                                  'DateInterval', 'createFromDateString'
         10        SEND_VAL                                                 '1+day'
         11        DO_FCALL                                      0  $13     
         12        ASSIGN                                                   !3, $13
    6    13        NEW                                              $15     'DatePeriod'
         14        SEND_VAR_EX                                              !1
         15        SEND_VAR_EX                                              !3
         16        SEND_VAR_EX                                              !2
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !4, $15
    7    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !4
         21        DO_ICALL                                                 
    8    22      > FE_RESET_R                                       $19     !4, ->31
         23    > > FE_FETCH_R                                               $19, !5, ->31
   10    24    >   INIT_METHOD_CALL                                         !5, 'format'
         25        SEND_VAL_EX                                              'N'
         26        DO_FCALL                                      0  $20     
         27        IS_EQUAL                                                 $20, 7
         28      > JMPZ                                                     ~21, ->30
   12    29    >   PRE_INC                                                  !0
    8    30    > > JMP                                                      ->23
         31    >   FE_FREE                                                  $19
   15    32        ECHO                                                     !0
   16    33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.69 ms | 1401 KiB | 15 Q