3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.4 ms | 1400 KiB | 17 Q