3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.28 ms | 1388 KiB | 17 Q