3v4l.org

run code in 300+ PHP versions simultaneously
<?php $nextMonday = new \DateTime(date('Y-m-d') . ' previous Monday'); echo $nextMonday->format('Y-m-d') . "\n"; for ($i=1 ; $i<=9 ; ++$i) { $nextMonday->sub(new DateInterval('P7D')); echo $nextMonday->format('Y-m-d') . "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 15
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 15
Branch analysis from position: 29
Branch analysis from position: 15
filename:       /in/FPis2
function name:  (null)
number of ops:  30
compiled vars:  !0 = $nextMonday, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $2      'DateTime'
          1        INIT_FCALL                                               'date'
          2        SEND_VAL                                                 'Y-m-d'
          3        DO_ICALL                                         $3      
          4        CONCAT                                           ~4      $3, '+previous+Monday'
          5        SEND_VAL_EX                                              ~4
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $2
    3     8        INIT_METHOD_CALL                                         !0, 'format'
          9        SEND_VAL_EX                                              'Y-m-d'
         10        DO_FCALL                                      0  $7      
         11        CONCAT                                           ~8      $7, '%0A'
         12        ECHO                                                     ~8
    4    13        ASSIGN                                                   !1, 1
         14      > JMP                                                      ->27
    5    15    >   INIT_METHOD_CALL                                         !0, 'sub'
         16        NEW                                              $10     'DateInterval'
         17        SEND_VAL_EX                                              'P7D'
         18        DO_FCALL                                      0          
         19        SEND_VAR_NO_REF_EX                                       $10
         20        DO_FCALL                                      0          
    6    21        INIT_METHOD_CALL                                         !0, 'format'
         22        SEND_VAL_EX                                              'Y-m-d'
         23        DO_FCALL                                      0  $13     
         24        CONCAT                                           ~14     $13, '%0A'
         25        ECHO                                                     ~14
    4    26        PRE_INC                                                  !1
         27    >   IS_SMALLER_OR_EQUAL                                      !1, 9
         28      > JMPNZ                                                    ~16, ->15
    7    29    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.13 ms | 999 KiB | 14 Q