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); $interval = new DateInterval('P1D'); $week = new DatePeriod($datetime, $interval, 6); foreach($week as $day){ $result[] = $day->format('d/m/Y D'); } return $result; } var_dump(daysInWeek(24));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VFWUS
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 = 25, Position 2 = 32
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 32
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/VFWUS
function name:  daysInWeek
number of ops:  35
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          
    7    14        NEW                                              $13     'DateInterval'
         15        SEND_VAL_EX                                              'P1D'
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !3, $13
    8    18        NEW                                              $16     'DatePeriod'
         19        SEND_VAR_EX                                              !2
         20        SEND_VAR_EX                                              !3
         21        SEND_VAL_EX                                              6
         22        DO_FCALL                                      0          
         23        ASSIGN                                                   !4, $16
   10    24      > FE_RESET_R                                       $19     !4, ->32
         25    > > FE_FETCH_R                                               $19, !5, ->32
   11    26    >   INIT_METHOD_CALL                                         !5, 'format'
         27        SEND_VAL_EX                                              'd%2Fm%2FY+D'
         28        DO_FCALL                                      0  $21     
         29        ASSIGN_DIM                                               !1
         30        OP_DATA                                                  $21
   10    31      > JMP                                                      ->25
         32    >   FE_FREE                                                  $19
   13    33      > RETURN                                                   !1
   14    34*     > RETURN                                                   null

End of function daysinweek

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.73 ms | 1403 KiB | 16 Q