3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = strtotime(date('2020-06-01 12:00')); for($x = 1; $x<=10; $x++) // increment $x until 10 { $period = $start - ($x * 1209600); // 1209600 is equivalent to 14 days. Multiply by $x $period_end = date('Y-m-d H:i', strtotime(date('Y-m-d H:i', $period). ' + 13 days')); echo date('Y-m-d H:i', $period) . " - " . $period_end ."<br>\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 9
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 9
Branch analysis from position: 36
Branch analysis from position: 9
filename:       /in/Uj2CA
function name:  (null)
number of ops:  37
compiled vars:  !0 = $start, !1 = $x, !2 = $period, !3 = $period_end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'strtotime'
          1        INIT_FCALL                                               'date'
          2        SEND_VAL                                                 '2020-06-01+12%3A00'
          3        DO_ICALL                                         $4      
          4        SEND_VAR                                                 $4
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !0, $5
    5     7        ASSIGN                                                   !1, 1
          8      > JMP                                                      ->34
    7     9    >   MUL                                              ~8      !1, 1209600
         10        SUB                                              ~9      !0, ~8
         11        ASSIGN                                                   !2, ~9
    8    12        INIT_FCALL                                               'date'
         13        SEND_VAL                                                 'Y-m-d+H%3Ai'
         14        INIT_FCALL                                               'strtotime'
         15        INIT_FCALL                                               'date'
         16        SEND_VAL                                                 'Y-m-d+H%3Ai'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $11     
         19        CONCAT                                           ~12     $11, '+%2B+13+days'
         20        SEND_VAL                                                 ~12
         21        DO_ICALL                                         $13     
         22        SEND_VAR                                                 $13
         23        DO_ICALL                                         $14     
         24        ASSIGN                                                   !3, $14
    9    25        INIT_FCALL                                               'date'
         26        SEND_VAL                                                 'Y-m-d+H%3Ai'
         27        SEND_VAR                                                 !2
         28        DO_ICALL                                         $16     
         29        CONCAT                                           ~17     $16, '+-+'
         30        CONCAT                                           ~18     ~17, !3
         31        CONCAT                                           ~19     ~18, '%3Cbr%3E%0A'
         32        ECHO                                                     ~19
    5    33        PRE_INC                                                  !1
         34    >   IS_SMALLER_OR_EQUAL                                      !1, 10
         35      > JMPNZ                                                    ~21, ->9
   10    36    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.56 ms | 1002 KiB | 15 Q