3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('first monday this month'); echo $start->format(DateTime::ISO8601); $end = new DateTime('last monday 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 = 22, Position 2 = 29
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 29
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/KdZsH
function name:  (null)
number of ops:  31
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+this+month'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    3     4        INIT_METHOD_CALL                                         !0, 'format'
          5        SEND_VAL_EX                                              'Y-m-d%5CTH%3Ai%3AsO'
          6        DO_FCALL                                      0  $7      
          7        ECHO                                                     $7
    4     8        NEW                                              $8      'DateTime'
          9        SEND_VAL_EX                                              'last+monday+this+month'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $8
    6    12        NEW                                              $11     'DatePeriod'
         13        SEND_VAR_EX                                              !0
         14        NEW                                              $12     'DateInterval'
         15        SEND_VAL_EX                                              'P7D'
         16        DO_FCALL                                      0          
         17        SEND_VAR_NO_REF_EX                                       $12
         18        SEND_VAR_EX                                              !1
         19        DO_FCALL                                      0          
         20        ASSIGN                                                   !2, $11
    8    21      > FE_RESET_R                                       $16     !2, ->29
         22    > > FE_FETCH_R                                               $16, !3, ->29
    9    23    >   INIT_METHOD_CALL                                         !3, 'format'
         24        SEND_VAL_EX                                              'Y-m-d%5CTH%3Ai%3AsO'
         25        DO_FCALL                                      0  $17     
         26        CONCAT                                           ~18     $17, '%0A'
         27        ECHO                                                     ~18
    8    28      > JMP                                                      ->22
         29    >   FE_FREE                                                  $16
   10    30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.85 ms | 1386 KiB | 13 Q