3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('2014-01-01'); $end = new DateTime('2015-01-01'); $weeks = array(); while ($start < $end) { $weeks[] = $start->format('d-m-Y'); $start->modify('+1 week'); } print_r($weeks);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 10
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 10
Branch analysis from position: 20
Branch analysis from position: 10
filename:       /in/WTtHb
function name:  (null)
number of ops:  24
compiled vars:  !0 = $start, !1 = $end, !2 = $weeks
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $3      'DateTime'
          1        SEND_VAL_EX                                              '2014-01-01'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    3     4        NEW                                              $6      'DateTime'
          5        SEND_VAL_EX                                              '2015-01-01'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
    5     8        ASSIGN                                                   !2, <array>
    6     9      > JMP                                                      ->18
    7    10    >   INIT_METHOD_CALL                                         !0, 'format'
         11        SEND_VAL_EX                                              'd-m-Y'
         12        DO_FCALL                                      0  $11     
         13        ASSIGN_DIM                                               !2
         14        OP_DATA                                                  $11
    8    15        INIT_METHOD_CALL                                         !0, 'modify'
         16        SEND_VAL_EX                                              '%2B1+week'
         17        DO_FCALL                                      0          
    6    18    >   IS_SMALLER                                               !0, !1
         19      > JMPNZ                                                    ~13, ->10
   10    20    >   INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.47 ms | 1395 KiB | 15 Q