3v4l.org

run code in 300+ PHP versions simultaneously
<?php $year = 2013; $week = 25; $Jan1 = mktime(0, 0, 0, 1, 1, $year); $MondayOffset = (11 - date('w', $Jan1)) % 7 - 3; $desiredMonday = strtotime(($week - 1) . ' weeks ' . $MondayOffset . ' days', $Jan1); $desiredSunday = strtotime('+0 week 0 days 1 hour', $desiredMonday); var_dump( $desiredMonday, $desiredSunday );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/I2rp0
function name:  (null)
number of ops:  38
compiled vars:  !0 = $year, !1 = $week, !2 = $Jan1, !3 = $MondayOffset, !4 = $desiredMonday, !5 = $desiredSunday
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 2013
    4     1        ASSIGN                                                   !1, 25
    6     2        INIT_FCALL                                               'mktime'
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 0
          6        SEND_VAL                                                 1
          7        SEND_VAL                                                 1
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !2, $8
    7    11        INIT_FCALL                                               'date'
         12        SEND_VAL                                                 'w'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $10     
         15        SUB                                              ~11     11, $10
         16        MOD                                              ~12     ~11, 7
         17        SUB                                              ~13     ~12, 3
         18        ASSIGN                                                   !3, ~13
    8    19        INIT_FCALL                                               'strtotime'
         20        SUB                                              ~15     !1, 1
         21        CONCAT                                           ~16     ~15, '+weeks+'
         22        CONCAT                                           ~17     ~16, !3
         23        CONCAT                                           ~18     ~17, '+days'
         24        SEND_VAL                                                 ~18
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                         $19     
         27        ASSIGN                                                   !4, $19
   10    28        INIT_FCALL                                               'strtotime'
         29        SEND_VAL                                                 '%2B0+week+0+days+1+hour'
         30        SEND_VAR                                                 !4
         31        DO_ICALL                                         $21     
         32        ASSIGN                                                   !5, $21
   12    33        INIT_FCALL                                               'var_dump'
         34        SEND_VAR                                                 !4
         35        SEND_VAR                                                 !5
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.95 ms | 1396 KiB | 21 Q