3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.6 ms | 1395 KiB | 19 Q