3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Asia/Singapore'); $strsum_enddate = date("Y-m-d"); $sumend_timestamp = strtotime($strsum_enddate); $tempstart_timestamp = strtotime("-1 day"); $strtemp_date = date("Y-m-d", $tempstart_timestamp); // $artemp = explode("-", $strsum_enddate); $artemp = explode("-", $strtemp_date); $startyear = intval($artemp[0]) - 1; // derive start-date from end-date $startmonth = $artemp[1]; if (substr($startmonth, 0, 1) == "0") { $startmonth = substr($startmonth, 1); } $startmonth = intval($startmonth); $startday = $artemp[2]; if (substr($startday, 0, 1) == "0") { $startday = substr($startday, 1); } $startday = intval($startday); if ($startmonth == 2 && $startday == 29) { // if feb 29, set to feb 28, 2 years is not a leap year if ($emember_flag == 0) { // if not emember, go back 1 year $startday = 28; } } $strsum_startdate = $startyear ."-". $startmonth ."-". $startday; $sumstart_timestamp = strtotime($strsum_startdate); if ($emember_flag == 1) { // if emember, then 3 months $sumstart_timestamp = $sumend_timestamp - 91; $strsum_startdate = date("Y-m-d", $sumstart_timestamp); } // $sumend_timestamp = $sumend_timestamp + $param_day_multiplier; // add 1 day to cover today $sumend_timestamp = $sumend_timestamp; // covers only until yesterday // die("debug start and end-date: ". $strsum_startdate ." ; ". $strsum_enddate); echo date('r', $strsum_startdate) . ' ' . date('r', $sumend_timestamp);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 43
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 59
Branch analysis from position: 54
2 jumps found. (Code = 46) Position 1 = 63, Position 2 = 65
Branch analysis from position: 63
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 69
Branch analysis from position: 66
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 69
Branch analysis from position: 68
2 jumps found. (Code = 43) Position 1 = 80, Position 2 = 87
Branch analysis from position: 80
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 87
Branch analysis from position: 69
Branch analysis from position: 69
Branch analysis from position: 65
Branch analysis from position: 59
Branch analysis from position: 43
filename:       /in/auGt1
function name:  (null)
number of ops:  100
compiled vars:  !0 = $strsum_enddate, !1 = $sumend_timestamp, !2 = $tempstart_timestamp, !3 = $strtemp_date, !4 = $artemp, !5 = $startyear, !6 = $startmonth, !7 = $startday, !8 = $emember_flag, !9 = $strsum_startdate, !10 = $sumstart_timestamp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'date_default_timezone_set'
          1        SEND_VAL                                                 'Asia%2FSingapore'
          2        DO_ICALL                                                 
    4     3        INIT_FCALL                                               'date'
          4        SEND_VAL                                                 'Y-m-d'
          5        DO_ICALL                                         $12     
          6        ASSIGN                                                   !0, $12
    5     7        INIT_FCALL                                               'strtotime'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $14     
         10        ASSIGN                                                   !1, $14
    6    11        INIT_FCALL                                               'strtotime'
         12        SEND_VAL                                                 '-1+day'
         13        DO_ICALL                                         $16     
         14        ASSIGN                                                   !2, $16
    7    15        INIT_FCALL                                               'date'
         16        SEND_VAL                                                 'Y-m-d'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $18     
         19        ASSIGN                                                   !3, $18
    9    20        INIT_FCALL                                               'explode'
         21        SEND_VAL                                                 '-'
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                         $20     
         24        ASSIGN                                                   !4, $20
   10    25        FETCH_DIM_R                                      ~22     !4, 0
         26        CAST                                          4  ~23     ~22
         27        SUB                                              ~24     ~23, 1
         28        ASSIGN                                                   !5, ~24
   11    29        FETCH_DIM_R                                      ~26     !4, 1
         30        ASSIGN                                                   !6, ~26
   12    31        INIT_FCALL                                               'substr'
         32        SEND_VAR                                                 !6
         33        SEND_VAL                                                 0
         34        SEND_VAL                                                 1
         35        DO_ICALL                                         $28     
         36        IS_EQUAL                                                 $28, '0'
         37      > JMPZ                                                     ~29, ->43
   13    38    >   INIT_FCALL                                               'substr'
         39        SEND_VAR                                                 !6
         40        SEND_VAL                                                 1
         41        DO_ICALL                                         $30     
         42        ASSIGN                                                   !6, $30
   15    43    >   CAST                                          4  ~32     !6
         44        ASSIGN                                                   !6, ~32
   16    45        FETCH_DIM_R                                      ~34     !4, 2
         46        ASSIGN                                                   !7, ~34
   17    47        INIT_FCALL                                               'substr'
         48        SEND_VAR                                                 !7
         49        SEND_VAL                                                 0
         50        SEND_VAL                                                 1
         51        DO_ICALL                                         $36     
         52        IS_EQUAL                                                 $36, '0'
         53      > JMPZ                                                     ~37, ->59
   18    54    >   INIT_FCALL                                               'substr'
         55        SEND_VAR                                                 !7
         56        SEND_VAL                                                 1
         57        DO_ICALL                                         $38     
         58        ASSIGN                                                   !7, $38
   20    59    >   CAST                                          4  ~40     !7
         60        ASSIGN                                                   !7, ~40
   21    61        IS_EQUAL                                         ~42     !6, 2
         62      > JMPZ_EX                                          ~42     ~42, ->65
         63    >   IS_EQUAL                                         ~43     !7, 29
         64        BOOL                                             ~42     ~43
         65    > > JMPZ                                                     ~42, ->69
   22    66    >   IS_EQUAL                                                 !8, 0
         67      > JMPZ                                                     ~44, ->69
   23    68    >   ASSIGN                                                   !7, 28
   26    69    >   CONCAT                                           ~46     !5, '-'
         70        CONCAT                                           ~47     ~46, !6
         71        CONCAT                                           ~48     ~47, '-'
         72        CONCAT                                           ~49     ~48, !7
         73        ASSIGN                                                   !9, ~49
   27    74        INIT_FCALL                                               'strtotime'
         75        SEND_VAR                                                 !9
         76        DO_ICALL                                         $51     
         77        ASSIGN                                                   !10, $51
   28    78        IS_EQUAL                                                 !8, 1
         79      > JMPZ                                                     ~53, ->87
   30    80    >   SUB                                              ~54     !1, 91
         81        ASSIGN                                                   !10, ~54
   31    82        INIT_FCALL                                               'date'
         83        SEND_VAL                                                 'Y-m-d'
         84        SEND_VAR                                                 !10
         85        DO_ICALL                                         $56     
         86        ASSIGN                                                   !9, $56
   34    87    >   ASSIGN                                                   !1, !1
   37    88        INIT_FCALL                                               'date'
         89        SEND_VAL                                                 'r'
         90        SEND_VAR                                                 !9
         91        DO_ICALL                                         $59     
         92        CONCAT                                           ~60     $59, '+'
         93        INIT_FCALL                                               'date'
         94        SEND_VAL                                                 'r'
         95        SEND_VAR                                                 !1
         96        DO_ICALL                                         $61     
         97        CONCAT                                           ~62     ~60, $61
         98        ECHO                                                     ~62
         99      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
213.38 ms | 1404 KiB | 23 Q