3v4l.org

run code in 500+ PHP versions simultaneously
<?php function getDateForWeekDay($year, $weekNo, $dayOfWeekNo) // return the exact date of this weekday, using ISO 8601 { $date = new DateTime(); $date->setISODate($year, $weekNo, $dayOfWeekNo); return $date->format('Y-m-d'); } for ($day = 1; $day <= 7; $day++) { $dates[$day] = getDateForWeekDay(2020, 34, $day); } print_r($dates);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 2
Branch analysis from position: 12
Branch analysis from position: 2
filename:       /in/iDKOu
function name:  (null)
number of ops:  16
compiled vars:  !0 = $day, !1 = $dates
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                       !0, 1
          1      > JMP                                                          ->10
   12     2    >   INIT_FCALL                                                   'getdateforweekday'
          3        SEND_VAL                                                     2020
          4        SEND_VAL                                                     34
          5        SEND_VAR                                                     !0
          6        DO_FCALL                                          0  $4      
          7        ASSIGN_DIM                                                   !1, !0
          8        OP_DATA                                                      $4
   11     9        PRE_INC                                                      !0
         10    >   IS_SMALLER_OR_EQUAL                                          !0, 7
         11      > JMPNZ                                                        ~6, ->2
   15    12    >   INIT_FCALL                                                   'print_r'
         13        SEND_VAR                                                     !1
         14        DO_ICALL                                                     
         15      > RETURN                                                       1

Function getdateforweekday:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iDKOu
function name:  getDateForWeekDay
number of ops:  16
compiled vars:  !0 = $year, !1 = $weekNo, !2 = $dayOfWeekNo, !3 = $date
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV                                                 !2      
    6     3        NEW                                                  $4      'DateTime'
          4        DO_FCALL                                          0          
          5        ASSIGN                                                       !3, $4
    7     6        INIT_METHOD_CALL                                             !3, 'setISODate'
          7        SEND_VAR_EX                                                  !0
          8        SEND_VAR_EX                                                  !1
          9        SEND_VAR_EX                                                  !2
         10        DO_FCALL                                          0          
    8    11        INIT_METHOD_CALL                                             !3, 'format'
         12        SEND_VAL_EX                                                  'Y-m-d'
         13        DO_FCALL                                          0  $8      
         14      > RETURN                                                       $8
    9    15*     > RETURN                                                       null

End of function getdateforweekday

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
190.3 ms | 1906 KiB | 15 Q