3v4l.org

run code in 300+ PHP versions simultaneously
<?php function daysInWeek($weekNum) { $result = array(); $datetime = new DateTime(); $datetime->setISODate((int)$datetime->format('Y'), $weekNum, 1)->setTime(0, 0, 0); $interval = new DateInterval('P1D'); $week = new DatePeriod($datetime, $interval, 6); foreach($week as $day){ $result[] = $day->format('D d m Y H:i:s'); } return $result; } var_dump(daysInWeek(24));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tcIfR
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'daysinweek'
          2        SEND_VAL                                                 24
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function daysinweek:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 30, Position 2 = 37
Branch analysis from position: 30
2 jumps found. (Code = 78) Position 1 = 31, Position 2 = 37
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/tcIfR
function name:  daysInWeek
number of ops:  40
compiled vars:  !0 = $weekNum, !1 = $result, !2 = $datetime, !3 = $interval, !4 = $week, !5 = $day
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <array>
    5     2        NEW                                              $7      'DateTime'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !2, $7
    6     5        INIT_METHOD_CALL                                         !2, 'setISODate'
          6        INIT_METHOD_CALL                                         !2, 'format'
          7        SEND_VAL_EX                                              'Y'
          8        DO_FCALL                                      0  $10     
          9        CAST                                          4  ~11     $10
         10        SEND_VAL_EX                                              ~11
         11        SEND_VAR_EX                                              !0
         12        SEND_VAL_EX                                              1
         13        DO_FCALL                                      0  $12     
         14        INIT_METHOD_CALL                                         $12, 'setTime'
         15        SEND_VAL_EX                                              0
         16        SEND_VAL_EX                                              0
         17        SEND_VAL_EX                                              0
         18        DO_FCALL                                      0          
    7    19        NEW                                              $14     'DateInterval'
         20        SEND_VAL_EX                                              'P1D'
         21        DO_FCALL                                      0          
         22        ASSIGN                                                   !3, $14
    8    23        NEW                                              $17     'DatePeriod'
         24        SEND_VAR_EX                                              !2
         25        SEND_VAR_EX                                              !3
         26        SEND_VAL_EX                                              6
         27        DO_FCALL                                      0          
         28        ASSIGN                                                   !4, $17
   10    29      > FE_RESET_R                                       $20     !4, ->37
         30    > > FE_FETCH_R                                               $20, !5, ->37
   11    31    >   INIT_METHOD_CALL                                         !5, 'format'
         32        SEND_VAL_EX                                              'D+d+m+Y+H%3Ai%3As'
         33        DO_FCALL                                      0  $22     
         34        ASSIGN_DIM                                               !1
         35        OP_DATA                                                  $22
   10    36      > JMP                                                      ->30
         37    >   FE_FREE                                                  $20
   13    38      > RETURN                                                   !1
   14    39*     > RETURN                                                   null

End of function daysinweek

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.92 ms | 1402 KiB | 16 Q