3v4l.org

run code in 300+ PHP versions simultaneously
<?php $weekModifier = 0; $date = new DateTime(); if($date->format('N') !== 1) { $date->sub(new DateInterval('P'. $date->format('N') . 'D')); } $interval = new DateInterval('P'.abs($weekModifier).'W'); if($weekModifier > 0) { $date->add($interval); } else { $date->sub($interval); } for($i = 1; $i <= 7; $i++) { echo $date->add(new DateInterval('P1D'))->format('l Y-m-d') . "<br>\n"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 35
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
2 jumps found. (Code = 44) Position 1 = 54, Position 2 = 40
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 54, Position 2 = 40
Branch analysis from position: 54
Branch analysis from position: 40
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
Branch analysis from position: 20
filename:       /in/tCiN1
function name:  (null)
number of ops:  55
compiled vars:  !0 = $weekModifier, !1 = $date, !2 = $interval, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
    5     1        NEW                                              $5      'DateTime'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
    7     4        INIT_METHOD_CALL                                         !1, 'format'
          5        SEND_VAL_EX                                              'N'
          6        DO_FCALL                                      0  $8      
          7        IS_NOT_IDENTICAL                                         $8, 1
          8      > JMPZ                                                     ~9, ->20
    8     9    >   INIT_METHOD_CALL                                         !1, 'sub'
         10        NEW                                              $10     'DateInterval'
         11        INIT_METHOD_CALL                                         !1, 'format'
         12        SEND_VAL_EX                                              'N'
         13        DO_FCALL                                      0  $11     
         14        CONCAT                                           ~12     'P', $11
         15        CONCAT                                           ~13     ~12, 'D'
         16        SEND_VAL_EX                                              ~13
         17        DO_FCALL                                      0          
         18        SEND_VAR_NO_REF_EX                                       $10
         19        DO_FCALL                                      0          
   11    20    >   NEW                                              $16     'DateInterval'
         21        INIT_FCALL                                               'abs'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $17     
         24        CONCAT                                           ~18     'P', $17
         25        CONCAT                                           ~19     ~18, 'W'
         26        SEND_VAL_EX                                              ~19
         27        DO_FCALL                                      0          
         28        ASSIGN                                                   !2, $16
   13    29        IS_SMALLER                                               0, !0
         30      > JMPZ                                                     ~22, ->35
   14    31    >   INIT_METHOD_CALL                                         !1, 'add'
         32        SEND_VAR_EX                                              !2
         33        DO_FCALL                                      0          
         34      > JMP                                                      ->38
   16    35    >   INIT_METHOD_CALL                                         !1, 'sub'
         36        SEND_VAR_EX                                              !2
         37        DO_FCALL                                      0          
   19    38    >   ASSIGN                                                   !3, 1
         39      > JMP                                                      ->52
   20    40    >   INIT_METHOD_CALL                                         !1, 'add'
         41        NEW                                              $26     'DateInterval'
         42        SEND_VAL_EX                                              'P1D'
         43        DO_FCALL                                      0          
         44        SEND_VAR_NO_REF_EX                                       $26
         45        DO_FCALL                                      0  $28     
         46        INIT_METHOD_CALL                                         $28, 'format'
         47        SEND_VAL_EX                                              'l+Y-m-d'
         48        DO_FCALL                                      0  $29     
         49        CONCAT                                           ~30     $29, '%3Cbr%3E%0A'
         50        ECHO                                                     ~30
   19    51        PRE_INC                                                  !3
         52    >   IS_SMALLER_OR_EQUAL                                      !3, 7
         53      > JMPNZ                                                    ~32, ->40
   23    54    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.75 ms | 1400 KiB | 15 Q