3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('first monday of this month'); $end = new DateTime('last monday of this month'); $dp = new DatePeriod($start, new DateInterval('P7D'), $end); foreach($dp as $d) { echo $d->format(DateTime::ISO8601).PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 25
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 25
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/V6Se8
function name:  (null)
number of ops:  27
compiled vars:  !0 = $start, !1 = $end, !2 = $dp, !3 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $4      'DateTime'
          1        SEND_VAL_EX                                              'first+monday+of+this+month'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    3     4        NEW                                              $7      'DateTime'
          5        SEND_VAL_EX                                              'last+monday+of+this+month'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
    6     8        NEW                                              $10     'DatePeriod'
          9        SEND_VAR_EX                                              !0
         10        NEW                                              $11     'DateInterval'
         11        SEND_VAL_EX                                              'P7D'
         12        DO_FCALL                                      0          
         13        SEND_VAR_NO_REF_EX                                       $11
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !2, $10
    8    17      > FE_RESET_R                                       $15     !2, ->25
         18    > > FE_FETCH_R                                               $15, !3, ->25
    9    19    >   INIT_METHOD_CALL                                         !3, 'format'
         20        SEND_VAL_EX                                              'Y-m-d%5CTH%3Ai%3AsO'
         21        DO_FCALL                                      0  $16     
         22        CONCAT                                           ~17     $16, '%0A'
         23        ECHO                                                     ~17
    8    24      > JMP                                                      ->18
         25    >   FE_FREE                                                  $15
   10    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.19 ms | 1394 KiB | 13 Q