3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startDate = "2009-10-11"; $endDate = "2010-01-20"; $dates = array(); $temp = strtotime($startDate); do { $dates[] = date("Y-m-d", $temp); $temp = strtotime("+1 week", $temp); } while ($temp < strtotime($endDate)); print_r($dates);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 7
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/Ikk9T
function name:  (null)
number of ops:  27
compiled vars:  !0 = $startDate, !1 = $endDate, !2 = $dates, !3 = $temp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2009-10-11'
    4     1        ASSIGN                                                   !1, '2010-01-20'
    6     2        ASSIGN                                                   !2, <array>
    7     3        INIT_FCALL                                               'strtotime'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !3, $7
   10     7    >   INIT_FCALL                                               'date'
          8        SEND_VAL                                                 'Y-m-d'
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                         $10     
         11        ASSIGN_DIM                                               !2
         12        OP_DATA                                                  $10
   11    13        INIT_FCALL                                               'strtotime'
         14        SEND_VAL                                                 '%2B1+week'
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                         $11     
         17        ASSIGN                                                   !3, $11
   12    18        INIT_FCALL                                               'strtotime'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                         $13     
         21        IS_SMALLER                                               !3, $13
         22      > JMPNZ                                                    ~14, ->7
   14    23    >   INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.5 ms | 1395 KiB | 19 Q