3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startTime = strtotime('2013-01-01 3:00'); $finishTime = strtotime('2013-03-01 3:00'); $lastMonthDay = strtotime(sprintf('last day of Jan'), $startTime); $dateTime = strtotime(sprintf('%s %s %s', 'Mon', '3:00', 'Jan'), $startTime); for (;$dateTime <= $lastMonthDay, $dateTime <= $finishTime; $dateTime = strtotime('+1 week', $dateTime)) { echo date ('d-m-Y H:i') . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 28
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 28
Branch analysis from position: 42
Branch analysis from position: 28
filename:       /in/CNGNm
function name:  (null)
number of ops:  43
compiled vars:  !0 = $startTime, !1 = $finishTime, !2 = $lastMonthDay, !3 = $dateTime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'strtotime'
          1        SEND_VAL                                                 '2013-01-01+3%3A00'
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    3     4        INIT_FCALL                                               'strtotime'
          5        SEND_VAL                                                 '2013-03-01+3%3A00'
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !1, $6
    4     8        INIT_FCALL                                               'strtotime'
          9        INIT_FCALL                                               'sprintf'
         10        SEND_VAL                                                 'last+day+of+Jan'
         11        DO_ICALL                                         $8      
         12        SEND_VAR                                                 $8
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $9      
         15        ASSIGN                                                   !2, $9
    5    16        INIT_FCALL                                               'strtotime'
         17        INIT_FCALL                                               'sprintf'
         18        SEND_VAL                                                 '%25s+%25s+%25s'
         19        SEND_VAL                                                 'Mon'
         20        SEND_VAL                                                 '3%3A00'
         21        SEND_VAL                                                 'Jan'
         22        DO_ICALL                                         $11     
         23        SEND_VAR                                                 $11
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                         $12     
         26        ASSIGN                                                   !3, $12
    6    27      > JMP                                                      ->38
    7    28    >   INIT_FCALL                                               'date'
         29        SEND_VAL                                                 'd-m-Y+H%3Ai'
         30        DO_ICALL                                         $14     
         31        CONCAT                                           ~15     $14, '%0A'
         32        ECHO                                                     ~15
    6    33        INIT_FCALL                                               'strtotime'
         34        SEND_VAL                                                 '%2B1+week'
         35        SEND_VAR                                                 !3
         36        DO_ICALL                                         $16     
         37        ASSIGN                                                   !3, $16
         38    >   IS_SMALLER_OR_EQUAL                              ~18     !3, !2
         39        FREE                                                     ~18
         40        IS_SMALLER_OR_EQUAL                                      !3, !1
         41      > JMPNZ                                                    ~19, ->28
    8    42    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.5 ms | 1400 KiB | 19 Q