3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.39 ms | 1404 KiB | 23 Q