3v4l.org

run code in 300+ PHP versions simultaneously
<?php $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 = 35, Position 2 = 40
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 56
Branch analysis from position: 51
2 jumps found. (Code = 46) Position 1 = 60, Position 2 = 62
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 63, Position 2 = 66
Branch analysis from position: 63
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 66
Branch analysis from position: 65
2 jumps found. (Code = 43) Position 1 = 77, Position 2 = 84
Branch analysis from position: 77
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 84
Branch analysis from position: 66
Branch analysis from position: 66
Branch analysis from position: 62
Branch analysis from position: 56
Branch analysis from position: 40
filename:       /in/8gXP2
function name:  (null)
number of ops:  97
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
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date'
          1        SEND_VAL                                                 'Y-m-d'
          2        DO_ICALL                                         $11     
          3        ASSIGN                                                   !0, $11
    4     4        INIT_FCALL                                               'strtotime'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $13     
          7        ASSIGN                                                   !1, $13
    5     8        INIT_FCALL                                               'strtotime'
          9        SEND_VAL                                                 '-1+day'
         10        DO_ICALL                                         $15     
         11        ASSIGN                                                   !2, $15
    6    12        INIT_FCALL                                               'date'
         13        SEND_VAL                                                 'Y-m-d'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $17     
         16        ASSIGN                                                   !3, $17
    8    17        INIT_FCALL                                               'explode'
         18        SEND_VAL                                                 '-'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                         $19     
         21        ASSIGN                                                   !4, $19
    9    22        FETCH_DIM_R                                      ~21     !4, 0
         23        CAST                                          4  ~22     ~21
         24        SUB                                              ~23     ~22, 1
         25        ASSIGN                                                   !5, ~23
   10    26        FETCH_DIM_R                                      ~25     !4, 1
         27        ASSIGN                                                   !6, ~25
   11    28        INIT_FCALL                                               'substr'
         29        SEND_VAR                                                 !6
         30        SEND_VAL                                                 0
         31        SEND_VAL                                                 1
         32        DO_ICALL                                         $27     
         33        IS_EQUAL                                                 $27, '0'
         34      > JMPZ                                                     ~28, ->40
   12    35    >   INIT_FCALL                                               'substr'
         36        SEND_VAR                                                 !6
         37        SEND_VAL                                                 1
         38        DO_ICALL                                         $29     
         39        ASSIGN                                                   !6, $29
   14    40    >   CAST                                          4  ~31     !6
         41        ASSIGN                                                   !6, ~31
   15    42        FETCH_DIM_R                                      ~33     !4, 2
         43        ASSIGN                                                   !7, ~33
   16    44        INIT_FCALL                                               'substr'
         45        SEND_VAR                                                 !7
         46        SEND_VAL                                                 0
         47        SEND_VAL                                                 1
         48        DO_ICALL                                         $35     
         49        IS_EQUAL                                                 $35, '0'
         50      > JMPZ                                                     ~36, ->56
   17    51    >   INIT_FCALL                                               'substr'
         52        SEND_VAR                                                 !7
         53        SEND_VAL                                                 1
         54        DO_ICALL                                         $37     
         55        ASSIGN                                                   !7, $37
   19    56    >   CAST                                          4  ~39     !7
         57        ASSIGN                                                   !7, ~39
   20    58        IS_EQUAL                                         ~41     !6, 2
         59      > JMPZ_EX                                          ~41     ~41, ->62
         60    >   IS_EQUAL                                         ~42     !7, 29
         61        BOOL                                             ~41     ~42
         62    > > JMPZ                                                     ~41, ->66
   21    63    >   IS_EQUAL                                                 !8, 0
         64      > JMPZ                                                     ~43, ->66
   22    65    >   ASSIGN                                                   !7, 28
   25    66    >   CONCAT                                           ~45     !5, '-'
         67        CONCAT                                           ~46     ~45, !6
         68        CONCAT                                           ~47     ~46, '-'
         69        CONCAT                                           ~48     ~47, !7
         70        ASSIGN                                                   !9, ~48
   26    71        INIT_FCALL                                               'strtotime'
         72        SEND_VAR                                                 !9
         73        DO_ICALL                                         $50     
         74        ASSIGN                                                   !10, $50
   27    75        IS_EQUAL                                                 !8, 1
         76      > JMPZ                                                     ~52, ->84
   29    77    >   SUB                                              ~53     !1, 91
         78        ASSIGN                                                   !10, ~53
   30    79        INIT_FCALL                                               'date'
         80        SEND_VAL                                                 'Y-m-d'
         81        SEND_VAR                                                 !10
         82        DO_ICALL                                         $55     
         83        ASSIGN                                                   !9, $55
   33    84    >   ASSIGN                                                   !1, !1
   36    85        INIT_FCALL                                               'date'
         86        SEND_VAL                                                 'r'
         87        SEND_VAR                                                 !9
         88        DO_ICALL                                         $58     
         89        CONCAT                                           ~59     $58, '+'
         90        INIT_FCALL                                               'date'
         91        SEND_VAL                                                 'r'
         92        SEND_VAR                                                 !1
         93        DO_ICALL                                         $60     
         94        CONCAT                                           ~61     ~59, $60
         95        ECHO                                                     ~61
         96      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.31 ms | 1404 KiB | 21 Q