3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getStartAndEndDate($week, $year) { $time = strtotime("1 January $year", time()); $day = date('w', $time); $time += ((7*$week)+1-$day)*24*3600; $return[0] = date('Y-m-d', $time); $time += 6*24*3600; $return[1] = date('Y-m-d', $time); return $return; } print_r(getStartAndEndDate(date('W'), 2017));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DtUIN
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'getstartandenddate'
          2        INIT_FCALL                                               'date'
          3        SEND_VAL                                                 'W'
          4        DO_ICALL                                         $0      
          5        SEND_VAR                                                 $0
          6        SEND_VAL                                                 2017
          7        DO_FCALL                                      0  $1      
          8        SEND_VAR                                                 $1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function getstartandenddate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DtUIN
function name:  getStartAndEndDate
number of ops:  37
compiled vars:  !0 = $week, !1 = $year, !2 = $time, !3 = $day, !4 = $return
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        INIT_FCALL                                               'strtotime'
          3        NOP                                                      
          4        FAST_CONCAT                                      ~5      '1+January+', !1
          5        SEND_VAL                                                 ~5
          6        INIT_FCALL                                               'time'
          7        DO_ICALL                                         $6      
          8        SEND_VAR                                                 $6
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !2, $7
    7    11        INIT_FCALL                                               'date'
         12        SEND_VAL                                                 'w'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $9      
         15        ASSIGN                                                   !3, $9
    8    16        MUL                                              ~11     !0, 7
         17        ADD                                              ~12     ~11, 1
         18        SUB                                              ~13     ~12, !3
         19        MUL                                              ~14     ~13, 24
         20        MUL                                              ~15     ~14, 3600
         21        ASSIGN_OP                                     1          !2, ~15
    9    22        INIT_FCALL                                               'date'
         23        SEND_VAL                                                 'Y-m-d'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                         $18     
         26        ASSIGN_DIM                                               !4, 0
         27        OP_DATA                                                  $18
   10    28        ASSIGN_OP                                     1          !2, 518400
   11    29        INIT_FCALL                                               'date'
         30        SEND_VAL                                                 'Y-m-d'
         31        SEND_VAR                                                 !2
         32        DO_ICALL                                         $21     
         33        ASSIGN_DIM                                               !4, 1
         34        OP_DATA                                                  $21
   12    35      > RETURN                                                   !4
   13    36*     > RETURN                                                   null

End of function getstartandenddate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.13 ms | 1403 KiB | 22 Q