3v4l.org

run code in 300+ PHP versions simultaneously
<?php $year = 2023; $firstDayOfYear = strtotime("first sunday january " . $year); //first Sunday of year $nextSunday = strtotime('sunday', $firstDayOfYear); $nextSaturday = strtotime('saturday', $nextSunday); $i = 0; while (date('Y', $nextSunday) == $year) { $filenames[$i] = date('M. j, Y', $nextSunday) . ' to ' . date('M. j, Y', $nextSaturday); $nextSaturday = strtotime('+1 week', $nextSaturday); $nextSunday = strtotime('+1 week', $nextSunday); $i++; } echo $filenames[0];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 18
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 18
Branch analysis from position: 47
Branch analysis from position: 18
filename:       /in/C3XuL
function name:  (null)
number of ops:  50
compiled vars:  !0 = $year, !1 = $firstDayOfYear, !2 = $nextSunday, !3 = $nextSaturday, !4 = $i, !5 = $filenames
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 2023
    3     1        INIT_FCALL                                               'strtotime'
          2        CONCAT                                           ~7      'first+sunday+january+', !0
          3        SEND_VAL                                                 ~7
          4        DO_ICALL                                         $8      
          5        ASSIGN                                                   !1, $8
    4     6        INIT_FCALL                                               'strtotime'
          7        SEND_VAL                                                 'sunday'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $10     
         10        ASSIGN                                                   !2, $10
    5    11        INIT_FCALL                                               'strtotime'
         12        SEND_VAL                                                 'saturday'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $12     
         15        ASSIGN                                                   !3, $12
    6    16        ASSIGN                                                   !4, 0
    7    17      > JMP                                                      ->41
    8    18    >   INIT_FCALL                                               'date'
         19        SEND_VAL                                                 'M.+j%2C+Y'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                         $16     
         22        CONCAT                                           ~17     $16, '+to+'
         23        INIT_FCALL                                               'date'
         24        SEND_VAL                                                 'M.+j%2C+Y'
         25        SEND_VAR                                                 !3
         26        DO_ICALL                                         $18     
         27        CONCAT                                           ~19     ~17, $18
         28        ASSIGN_DIM                                               !5, !4
         29        OP_DATA                                                  ~19
    9    30        INIT_FCALL                                               'strtotime'
         31        SEND_VAL                                                 '%2B1+week'
         32        SEND_VAR                                                 !3
         33        DO_ICALL                                         $20     
         34        ASSIGN                                                   !3, $20
   10    35        INIT_FCALL                                               'strtotime'
         36        SEND_VAL                                                 '%2B1+week'
         37        SEND_VAR                                                 !2
         38        DO_ICALL                                         $22     
         39        ASSIGN                                                   !2, $22
   11    40        PRE_INC                                                  !4
    7    41    >   INIT_FCALL                                               'date'
         42        SEND_VAL                                                 'Y'
         43        SEND_VAR                                                 !2
         44        DO_ICALL                                         $25     
         45        IS_EQUAL                                                 !0, $25
         46      > JMPNZ                                                    ~26, ->18
   14    47    >   FETCH_DIM_R                                      ~27     !5, 0
         48        ECHO                                                     ~27
         49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.4 ms | 1438 KiB | 15 Q