3v4l.org

run code in 300+ PHP versions simultaneously
<?php $month = 2; $year = 2017; $week = date("W", strtotime($year . "-" . $month ."-01")); Echo date("d/m/Y", strtotime($year . "-" . $month ."-01")) ." - "; $unix = strtotime($year."W".$week ."+1 week"); While(date("m", $unix) == $month){ Echo date("d/m/Y", $unix-86400) . "\n"; Echo date("d/m/Y", $unix) ." - "; $unix = $unix + (86400*7); } Echo date("d/m/Y", strtotime("last day of ".$year . "-" . $month));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 54, Position 2 = 33
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 54, Position 2 = 33
Branch analysis from position: 54
Branch analysis from position: 33
filename:       /in/LAMBl
function name:  (null)
number of ops:  66
compiled vars:  !0 = $month, !1 = $year, !2 = $week, !3 = $unix
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 2
    4     1        ASSIGN                                                   !1, 2017
    6     2        INIT_FCALL                                               'date'
          3        SEND_VAL                                                 'W'
          4        INIT_FCALL                                               'strtotime'
          5        CONCAT                                           ~6      !1, '-'
          6        CONCAT                                           ~7      ~6, !0
          7        CONCAT                                           ~8      ~7, '-01'
          8        SEND_VAL                                                 ~8
          9        DO_ICALL                                         $9      
         10        SEND_VAR                                                 $9
         11        DO_ICALL                                         $10     
         12        ASSIGN                                                   !2, $10
    8    13        INIT_FCALL                                               'date'
         14        SEND_VAL                                                 'd%2Fm%2FY'
         15        INIT_FCALL                                               'strtotime'
         16        CONCAT                                           ~12     !1, '-'
         17        CONCAT                                           ~13     ~12, !0
         18        CONCAT                                           ~14     ~13, '-01'
         19        SEND_VAL                                                 ~14
         20        DO_ICALL                                         $15     
         21        SEND_VAR                                                 $15
         22        DO_ICALL                                         $16     
         23        CONCAT                                           ~17     $16, '+-+'
         24        ECHO                                                     ~17
    9    25        INIT_FCALL                                               'strtotime'
         26        CONCAT                                           ~18     !1, 'W'
         27        CONCAT                                           ~19     ~18, !2
         28        CONCAT                                           ~20     ~19, '%2B1+week'
         29        SEND_VAL                                                 ~20
         30        DO_ICALL                                         $21     
         31        ASSIGN                                                   !3, $21
   10    32      > JMP                                                      ->48
   12    33    >   INIT_FCALL                                               'date'
         34        SEND_VAL                                                 'd%2Fm%2FY'
         35        SUB                                              ~23     !3, 86400
         36        SEND_VAL                                                 ~23
         37        DO_ICALL                                         $24     
         38        CONCAT                                           ~25     $24, '%0A'
         39        ECHO                                                     ~25
   13    40        INIT_FCALL                                               'date'
         41        SEND_VAL                                                 'd%2Fm%2FY'
         42        SEND_VAR                                                 !3
         43        DO_ICALL                                         $26     
         44        CONCAT                                           ~27     $26, '+-+'
         45        ECHO                                                     ~27
   14    46        ADD                                              ~28     !3, 604800
         47        ASSIGN                                                   !3, ~28
   10    48    >   INIT_FCALL                                               'date'
         49        SEND_VAL                                                 'm'
         50        SEND_VAR                                                 !3
         51        DO_ICALL                                         $30     
         52        IS_EQUAL                                                 !0, $30
         53      > JMPNZ                                                    ~31, ->33
   16    54    >   INIT_FCALL                                               'date'
         55        SEND_VAL                                                 'd%2Fm%2FY'
         56        INIT_FCALL                                               'strtotime'
         57        CONCAT                                           ~32     'last+day+of+', !1
         58        CONCAT                                           ~33     ~32, '-'
         59        CONCAT                                           ~34     ~33, !0
         60        SEND_VAL                                                 ~34
         61        DO_ICALL                                         $35     
         62        SEND_VAR                                                 $35
         63        DO_ICALL                                         $36     
         64        ECHO                                                     $36
         65      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
252.97 ms | 1078 KiB | 15 Q