3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = '10-07-2017'; $now = new DateTime($date); echo 'Now: ' . $now->format('d-m-Y') . "\n"; echo "\n"; $startOfWeek = clone $now; $startOfWeek->modify('Monday this week'); echo 'Monday: ' . $startOfWeek->format('d-m-Y') . "\n"; $endOfWeek = clone $now; $endOfWeek->modify('Friday this week'); echo 'Friday: ' . $endOfWeek->format('d-m-Y') . "\n"; for ($i = 0; $i < 4; $i++) { echo "\n"; $startOfWeek->modify('Monday next week'); echo 'Next Monday: ' . $startOfWeek->format('d-m-Y') . "\n"; $endOfWeek->modify('Friday next week'); echo 'Next Friday: ' . $endOfWeek->format('d-m-Y') . "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
2 jumps found. (Code = 44) Position 1 = 58, Position 2 = 36
Branch analysis from position: 58
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 58, Position 2 = 36
Branch analysis from position: 58
Branch analysis from position: 36
filename:       /in/cpV4q
function name:  (null)
number of ops:  59
compiled vars:  !0 = $date, !1 = $now, !2 = $startOfWeek, !3 = $endOfWeek, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '10-07-2017'
    5     1        NEW                                              $6      'DateTime'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $6
    6     5        INIT_METHOD_CALL                                         !1, 'format'
          6        SEND_VAL_EX                                              'd-m-Y'
          7        DO_FCALL                                      0  $9      
          8        CONCAT                                           ~10     'Now%3A+', $9
          9        CONCAT                                           ~11     ~10, '%0A'
         10        ECHO                                                     ~11
    8    11        ECHO                                                     '%0A'
   10    12        CLONE                                            ~12     !1
         13        ASSIGN                                                   !2, ~12
   11    14        INIT_METHOD_CALL                                         !2, 'modify'
         15        SEND_VAL_EX                                              'Monday+this+week'
         16        DO_FCALL                                      0          
   12    17        INIT_METHOD_CALL                                         !2, 'format'
         18        SEND_VAL_EX                                              'd-m-Y'
         19        DO_FCALL                                      0  $15     
         20        CONCAT                                           ~16     'Monday%3A+', $15
         21        CONCAT                                           ~17     ~16, '%0A'
         22        ECHO                                                     ~17
   14    23        CLONE                                            ~18     !1
         24        ASSIGN                                                   !3, ~18
   15    25        INIT_METHOD_CALL                                         !3, 'modify'
         26        SEND_VAL_EX                                              'Friday+this+week'
         27        DO_FCALL                                      0          
   16    28        INIT_METHOD_CALL                                         !3, 'format'
         29        SEND_VAL_EX                                              'd-m-Y'
         30        DO_FCALL                                      0  $21     
         31        CONCAT                                           ~22     'Friday%3A+', $21
         32        CONCAT                                           ~23     ~22, '%0A'
         33        ECHO                                                     ~23
   18    34        ASSIGN                                                   !4, 0
         35      > JMP                                                      ->56
   19    36    >   ECHO                                                     '%0A'
   21    37        INIT_METHOD_CALL                                         !2, 'modify'
         38        SEND_VAL_EX                                              'Monday+next+week'
         39        DO_FCALL                                      0          
   22    40        INIT_METHOD_CALL                                         !2, 'format'
         41        SEND_VAL_EX                                              'd-m-Y'
         42        DO_FCALL                                      0  $26     
         43        CONCAT                                           ~27     'Next+Monday%3A+', $26
         44        CONCAT                                           ~28     ~27, '%0A'
         45        ECHO                                                     ~28
   24    46        INIT_METHOD_CALL                                         !3, 'modify'
         47        SEND_VAL_EX                                              'Friday+next+week'
         48        DO_FCALL                                      0          
   25    49        INIT_METHOD_CALL                                         !3, 'format'
         50        SEND_VAL_EX                                              'd-m-Y'
         51        DO_FCALL                                      0  $30     
         52        CONCAT                                           ~31     'Next+Friday%3A+', $30
         53        CONCAT                                           ~32     ~31, '%0A'
         54        ECHO                                                     ~32
   18    55        PRE_INC                                                  !4
         56    >   IS_SMALLER                                               !4, 4
         57      > JMPNZ                                                    ~34, ->36
   26    58    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.66 ms | 1399 KiB | 13 Q