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); echo $sumstart_timestamp . "\n"; echo $sumend_timestamp . "\n";
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
1 jumps found. (Code = 62) Position 1 = -2
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/rTWK7
function name:  (null)
number of ops:  80
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'
          1        SEND_VAL                                                 'Y-m-d'
          2        DO_ICALL                                         $11     
          3        ASSIGN                                                   !0, $11
    3     4        INIT_FCALL                                               'strtotime'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $13     
          7        ASSIGN                                                   !1, $13
    4     8        INIT_FCALL                                               'strtotime'
          9        SEND_VAL                                                 '-1+day'
         10        DO_ICALL                                         $15     
         11        ASSIGN                                                   !2, $15
    5    12        INIT_FCALL                                               'date'
         13        SEND_VAL                                                 'Y-m-d'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $17     
         16        ASSIGN                                                   !3, $17
    7    17        INIT_FCALL                                               'explode'
         18        SEND_VAL                                                 '-'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                         $19     
         21        ASSIGN                                                   !4, $19
    8    22        FETCH_DIM_R                                      ~21     !4, 0
         23        CAST                                          4  ~22     ~21
         24        SUB                                              ~23     ~22, 1
         25        ASSIGN                                                   !5, ~23
    9    26        FETCH_DIM_R                                      ~25     !4, 1
         27        ASSIGN                                                   !6, ~25
   10    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
   11    35    >   INIT_FCALL                                               'substr'
         36        SEND_VAR                                                 !6
         37        SEND_VAL                                                 1
         38        DO_ICALL                                         $29     
         39        ASSIGN                                                   !6, $29
   13    40    >   CAST                                          4  ~31     !6
         41        ASSIGN                                                   !6, ~31
   14    42        FETCH_DIM_R                                      ~33     !4, 2
         43        ASSIGN                                                   !7, ~33
   15    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
   16    51    >   INIT_FCALL                                               'substr'
         52        SEND_VAR                                                 !7
         53        SEND_VAL                                                 1
         54        DO_ICALL                                         $37     
         55        ASSIGN                                                   !7, $37
   18    56    >   CAST                                          4  ~39     !7
         57        ASSIGN                                                   !7, ~39
   19    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
   20    63    >   IS_EQUAL                                                 !8, 0
         64      > JMPZ                                                     ~43, ->66
   21    65    >   ASSIGN                                                   !7, 28
   24    66    >   CONCAT                                           ~45     !5, '-'
         67        CONCAT                                           ~46     ~45, !6
         68        CONCAT                                           ~47     ~46, '-'
         69        CONCAT                                           ~48     ~47, !7
         70        ASSIGN                                                   !9, ~48
   25    71        INIT_FCALL                                               'strtotime'
         72        SEND_VAR                                                 !9
         73        DO_ICALL                                         $50     
         74        ASSIGN                                                   !10, $50
   27    75        CONCAT                                           ~52     !10, '%0A'
         76        ECHO                                                     ~52
   28    77        CONCAT                                           ~53     !1, '%0A'
         78        ECHO                                                     ~53
         79      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.28 ms | 1400 KiB | 21 Q