3v4l.org

run code in 300+ PHP versions simultaneously
<?php // all fridays from startingdate till NOW $display_only_the_most_recent_friday = false; // all fridays or most recent only $startingDate = strtotime('2013-01-01'); // lets test from start of 2013 $start = time(); // now $end = $startingDate; // our loop will $start from now and scan back till the $end // we will check every day from $start to $end // in every loop we are going one day back -=(60 * 60 * 24) for($checkdate=$start;$checkdate>=$end; $checkdate -=(60 * 60 * 24)) { if ( date('N', $checkdate) == "5" ) // and if this day is the fifth day we echo { echo '<a href="https://www.extranet.frostyacres.com/portal_resources/1/Market Report '.date('m-d-y', $checkdate).'.pdf">Market Reports</a>'; if($display_only_the_most_recent_friday) break; } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 11
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 26
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 26
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 11
Branch analysis from position: 29
Branch analysis from position: 11
Branch analysis from position: 26
filename:       /in/6mZ6e
function name:  (null)
number of ops:  30
compiled vars:  !0 = $display_only_the_most_recent_friday, !1 = $startingDate, !2 = $start, !3 = $end, !4 = $checkdate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <false>
    5     1        INIT_FCALL                                               'strtotime'
          2        SEND_VAL                                                 '2013-01-01'
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
    7     5        INIT_FCALL                                               'time'
          6        DO_ICALL                                         $8      
          7        ASSIGN                                                   !2, $8
    8     8        ASSIGN                                                   !3, !1
   12     9        ASSIGN                                                   !4, !2
         10      > JMP                                                      ->27
   14    11    >   INIT_FCALL                                               'date'
         12        SEND_VAL                                                 'N'
         13        SEND_VAR                                                 !4
         14        DO_ICALL                                         $12     
         15        IS_EQUAL                                                 $12, '5'
         16      > JMPZ                                                     ~13, ->26
   16    17    >   INIT_FCALL                                               'date'
         18        SEND_VAL                                                 'm-d-y'
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                         $14     
         21        CONCAT                                           ~15     '%3Ca+href%3D%22https%3A%2F%2Fwww.extranet.frostyacres.com%2Fportal_resources%2F1%2FMarket+Report+', $14
         22        CONCAT                                           ~16     ~15, '.pdf%22%3EMarket+Reports%3C%2Fa%3E'
         23        ECHO                                                     ~16
   17    24      > JMPZ                                                     !0, ->26
   18    25    > > JMP                                                      ->29
   12    26    >   ASSIGN_OP                                     2          !4, 86400
         27    >   IS_SMALLER_OR_EQUAL                                      !3, !4
         28      > JMPNZ                                                    ~18, ->11
   22    29    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.1 ms | 1396 KiB | 19 Q