3v4l.org

run code in 300+ PHP versions simultaneously
<?php $Input = "08/12/2017"; if(date("l", strtotime($Input)) == "Saturday"){ $Saturday = strtotime($Input); }else{ $Saturday = strtotime($Input . " previous saturday"); } $Friday = strtotime(date("m/d/Y", $Saturday) . " next friday"); echo date("m/d/Y", $Saturday) . " to " . date("m/d/Y", $Friday);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l4g8D
function name:  (null)
number of ops:  41
compiled vars:  !0 = $Input, !1 = $Saturday, !2 = $Friday
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '08%2F12%2F2017'
    3     1        INIT_FCALL                                               'date'
          2        SEND_VAL                                                 'l'
          3        INIT_FCALL                                               'strtotime'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                         $5      
          8        IS_EQUAL                                                 $5, 'Saturday'
          9      > JMPZ                                                     ~6, ->15
    4    10    >   INIT_FCALL                                               'strtotime'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !1, $7
         14      > JMP                                                      ->20
    6    15    >   INIT_FCALL                                               'strtotime'
         16        CONCAT                                           ~9      !0, '+previous+saturday'
         17        SEND_VAL                                                 ~9
         18        DO_ICALL                                         $10     
         19        ASSIGN                                                   !1, $10
    8    20    >   INIT_FCALL                                               'strtotime'
         21        INIT_FCALL                                               'date'
         22        SEND_VAL                                                 'm%2Fd%2FY'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $12     
         25        CONCAT                                           ~13     $12, '+next+friday'
         26        SEND_VAL                                                 ~13
         27        DO_ICALL                                         $14     
         28        ASSIGN                                                   !2, $14
   10    29        INIT_FCALL                                               'date'
         30        SEND_VAL                                                 'm%2Fd%2FY'
         31        SEND_VAR                                                 !1
         32        DO_ICALL                                         $16     
         33        CONCAT                                           ~17     $16, '+to+'
         34        INIT_FCALL                                               'date'
         35        SEND_VAL                                                 'm%2Fd%2FY'
         36        SEND_VAR                                                 !2
         37        DO_ICALL                                         $18     
         38        CONCAT                                           ~19     ~17, $18
         39        ECHO                                                     ~19
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
129.45 ms | 1401 KiB | 17 Q