3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.66 ms | 1385 KiB | 13 Q