3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getStartAndEndDate($week, $year) { $dto = new DateTime(); $result[0] = $dto->setISODate($year, $week, 0)->format('Y-m-d'); $result[1] = $dto->setISODate($year, $week, 6)->format('Y-m-d'); return $result; } print_r(getStartAndEndDate(date('W'), 2017));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eTKA0
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     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/eTKA0
function name:  getStartAndEndDate
number of ops:  27
compiled vars:  !0 = $week, !1 = $year, !2 = $dto, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        NEW                                              $4      'DateTime'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !2, $4
    7     5        INIT_METHOD_CALL                                         !2, 'setISODate'
          6        SEND_VAR_EX                                              !1
          7        SEND_VAR_EX                                              !0
          8        SEND_VAL_EX                                              0
          9        DO_FCALL                                      0  $8      
         10        INIT_METHOD_CALL                                         $8, 'format'
         11        SEND_VAL_EX                                              'Y-m-d'
         12        DO_FCALL                                      0  $9      
         13        ASSIGN_DIM                                               !3, 0
         14        OP_DATA                                                  $9
    8    15        INIT_METHOD_CALL                                         !2, 'setISODate'
         16        SEND_VAR_EX                                              !1
         17        SEND_VAR_EX                                              !0
         18        SEND_VAL_EX                                              6
         19        DO_FCALL                                      0  $11     
         20        INIT_METHOD_CALL                                         $11, 'format'
         21        SEND_VAL_EX                                              'Y-m-d'
         22        DO_FCALL                                      0  $12     
         23        ASSIGN_DIM                                               !3, 1
         24        OP_DATA                                                  $12
    9    25      > RETURN                                                   !3
   10    26*     > RETURN                                                   null

End of function getstartandenddate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.86 ms | 1399 KiB | 18 Q