3v4l.org

run code in 500+ PHP versions simultaneously
<?php $month = "March"; If(date("w", strtotime("last day of ". $month)) >= 5){ $unix = strtotime("last day of ". $month)-86400*6; Echo date("Y-m-d", strtotime("previous Friday " .date("Y-m-d", $unix))); }Else{ Echo date("Y-m-d", strtotime("previous Friday " .date("Y-m-d",strtotime("last day of ". $month)))); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 31
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/O4TDd
function name:  (null)
number of ops:  49
compiled vars:  !0 = $month, !1 = $unix
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 'March'
    3     1        INIT_FCALL                                                   'date'
          2        SEND_VAL                                                     'w'
          3        INIT_FCALL                                                   'strtotime'
          4        CONCAT                                               ~3      'last+day+of+', !0
          5        SEND_VAL                                                     ~3
          6        DO_ICALL                                             $4      
          7        SEND_VAR                                                     $4
          8        DO_ICALL                                             $5      
          9        IS_SMALLER_OR_EQUAL                                          5, $5
         10      > JMPZ                                                         ~6, ->31
    4    11    >   INIT_FCALL                                                   'strtotime'
         12        CONCAT                                               ~7      'last+day+of+', !0
         13        SEND_VAL                                                     ~7
         14        DO_ICALL                                             $8      
         15        SUB                                                  ~9      $8, 518400
         16        ASSIGN                                                       !1, ~9
    5    17        INIT_FCALL                                                   'date'
         18        SEND_VAL                                                     'Y-m-d'
         19        INIT_FCALL                                                   'strtotime'
         20        INIT_FCALL                                                   'date'
         21        SEND_VAL                                                     'Y-m-d'
         22        SEND_VAR                                                     !1
         23        DO_ICALL                                             $11     
         24        CONCAT                                               ~12     'previous+Friday+', $11
         25        SEND_VAL                                                     ~12
         26        DO_ICALL                                             $13     
         27        SEND_VAR                                                     $13
         28        DO_ICALL                                             $14     
         29        ECHO                                                         $14
    3    30      > JMP                                                          ->48
    7    31    >   INIT_FCALL                                                   'date'
         32        SEND_VAL                                                     'Y-m-d'
         33        INIT_FCALL                                                   'strtotime'
         34        INIT_FCALL                                                   'date'
         35        SEND_VAL                                                     'Y-m-d'
         36        INIT_FCALL                                                   'strtotime'
         37        CONCAT                                               ~15     'last+day+of+', !0
         38        SEND_VAL                                                     ~15
         39        DO_ICALL                                             $16     
         40        SEND_VAR                                                     $16
         41        DO_ICALL                                             $17     
         42        CONCAT                                               ~18     'previous+Friday+', $17
         43        SEND_VAL                                                     ~18
         44        DO_ICALL                                             $19     
         45        SEND_VAR                                                     $19
         46        DO_ICALL                                             $20     
         47        ECHO                                                         $20
    8    48    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.17 ms | 2581 KiB | 15 Q