3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = date('l'); 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 = 6, Position 2 = 23
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6N0D3
function name:  (null)
number of ops:  42
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                                           ~5      !0, 'Sunday'
          5      > JMPZ                                                     ~5, ->23
    5     6    >   INIT_FCALL                                               'date'
          7        SEND_VAL                                                 'Y-m-d'
          8        INIT_FCALL                                               'strtotime'
          9        SEND_VAL                                                 'Sunday+last+week'
         10        DO_ICALL                                         $6      
         11        SEND_VAR                                                 $6
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !1, $7
    6    14        INIT_FCALL                                               'date'
         15        SEND_VAL                                                 'Y-m-d'
         16        INIT_FCALL                                               'strtotime'
         17        SEND_VAL                                                 'Monday+last+week'
         18        DO_ICALL                                         $9      
         19        SEND_VAR                                                 $9
         20        DO_ICALL                                         $10     
         21        ASSIGN                                                   !2, $10
         22      > JMP                                                      ->39
    8    23    >   INIT_FCALL                                               'date'
         24        SEND_VAL                                                 'Y-m-d'
         25        INIT_FCALL                                               'strtotime'
         26        SEND_VAL                                                 'Sunday+this+week'
         27        DO_ICALL                                         $12     
         28        SEND_VAR                                                 $12
         29        DO_ICALL                                         $13     
         30        ASSIGN                                                   !1, $13
    9    31        INIT_FCALL                                               'date'
         32        SEND_VAL                                                 'Y-m-d'
         33        INIT_FCALL                                               'strtotime'
         34        SEND_VAL                                                 'Monday+this+week'
         35        DO_ICALL                                         $15     
         36        SEND_VAR                                                 $15
         37        DO_ICALL                                         $16     
         38        ASSIGN                                                   !2, $16
   12    39    >   ECHO                                                     !2
   13    40        ECHO                                                     !1
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.32 ms | 1400 KiB | 17 Q