3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTimeImmutable('2012-01-01'); $end = new DateTimeImmutable('2014-12-31'); while($start <= $end) { $nextdate = ($start->modify('+1 month'))->format('Y-m-d'); $prevdate = ($start->modify('-1 month'))->format('Y-m-d'); echo $prevdate.'<br>'; echo $nextdate.'<br>'; $start = $start->modify('+1 month'); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 9
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 9
Branch analysis from position: 33
Branch analysis from position: 9
filename:       /in/Tmol2
function name:  (null)
number of ops:  34
compiled vars:  !0 = $start, !1 = $end, !2 = $nextdate, !3 = $prevdate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $4      'DateTimeImmutable'
          1        SEND_VAL_EX                                              '2012-01-01'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    3     4        NEW                                              $7      'DateTimeImmutable'
          5        SEND_VAL_EX                                              '2014-12-31'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
    4     8      > JMP                                                      ->31
    5     9    >   INIT_METHOD_CALL                                         !0, 'modify'
         10        SEND_VAL_EX                                              '%2B1+month'
         11        DO_FCALL                                      0  $10     
         12        INIT_METHOD_CALL                                         $10, 'format'
         13        SEND_VAL_EX                                              'Y-m-d'
         14        DO_FCALL                                      0  $11     
         15        ASSIGN                                                   !2, $11
    6    16        INIT_METHOD_CALL                                         !0, 'modify'
         17        SEND_VAL_EX                                              '-1+month'
         18        DO_FCALL                                      0  $13     
         19        INIT_METHOD_CALL                                         $13, 'format'
         20        SEND_VAL_EX                                              'Y-m-d'
         21        DO_FCALL                                      0  $14     
         22        ASSIGN                                                   !3, $14
    7    23        CONCAT                                           ~16     !3, '%3Cbr%3E'
         24        ECHO                                                     ~16
    8    25        CONCAT                                           ~17     !2, '%3Cbr%3E'
         26        ECHO                                                     ~17
    9    27        INIT_METHOD_CALL                                         !0, 'modify'
         28        SEND_VAL_EX                                              '%2B1+month'
         29        DO_FCALL                                      0  $18     
         30        ASSIGN                                                   !0, $18
    4    31    >   IS_SMALLER_OR_EQUAL                                      !0, !1
         32      > JMPNZ                                                    ~20, ->9
   10    33    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.05 ms | 1386 KiB | 13 Q