3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Berlin'); $date = new DateTime('2015-04-18 22:41:51'); $start = new DateTime("monday this week {$date->format('Y-m-d')}"); $end = new DateTime("monday next week {$date->format('Y-m-d')}"); $end->modify('-1 second'); echo '<pre>'; var_dump($start, $end, date("w")); echo '</pre>';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R60YN
function name:  (null)
number of ops:  39
compiled vars:  !0 = $date, !1 = $start, !2 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'Europe%2FBerlin'
          2        DO_ICALL                                                 
    5     3        NEW                                              $4      'DateTime'
          4        SEND_VAL_EX                                              '2015-04-18+22%3A41%3A51'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $4
    7     7        NEW                                              $7      'DateTime'
          8        NOP                                                      
          9        INIT_METHOD_CALL                                         !0, 'format'
         10        SEND_VAL_EX                                              'Y-m-d'
         11        DO_FCALL                                      0  $8      
         12        FAST_CONCAT                                      ~9      'monday+this+week+', $8
         13        SEND_VAL_EX                                              ~9
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !1, $7
    8    16        NEW                                              $12     'DateTime'
         17        NOP                                                      
         18        INIT_METHOD_CALL                                         !0, 'format'
         19        SEND_VAL_EX                                              'Y-m-d'
         20        DO_FCALL                                      0  $13     
         21        FAST_CONCAT                                      ~14     'monday+next+week+', $13
         22        SEND_VAL_EX                                              ~14
         23        DO_FCALL                                      0          
         24        ASSIGN                                                   !2, $12
    9    25        INIT_METHOD_CALL                                         !2, 'modify'
         26        SEND_VAL_EX                                              '-1+second'
         27        DO_FCALL                                      0          
   11    28        ECHO                                                     '%3Cpre%3E'
   12    29        INIT_FCALL                                               'var_dump'
         30        SEND_VAR                                                 !1
         31        SEND_VAR                                                 !2
         32        INIT_FCALL                                               'date'
         33        SEND_VAL                                                 'w'
         34        DO_ICALL                                         $18     
         35        SEND_VAR                                                 $18
         36        DO_ICALL                                                 
   13    37        ECHO                                                     '%3C%2Fpre%3E'
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.75 ms | 1396 KiB | 19 Q