3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* this section for emember num days */ // $strvalidstart = "2012-03-01"; // debug $emember_numdays = 0; $param_day_multiplier = 24 * 60 * 60; $stremember_finaldate = ""; if ($strvalidstart != "") { $curr_timestamp = time(); $start_timestamp = strtotime($strvalidstart); if (floatval($strpointbal) <= 0) { // if no receipts / no points, start counting from current date $start_timestamp = $curr_timestamp; } $timediff = $curr_timestamp - $start_timestamp; // $end_timestamp = $start_timestamp + (90 * $param_day_multiplier); /* modified by ZY 13 Jul 2012, calc 3 months on the exact day */ $end_yy = intval(date("Y", $curr_timestamp)); $end_mm = intval(date("m", $curr_timestamp)); $end_dd = intval(date("d", $curr_timestamp)); if ($end_mm >= 10) { $end_yy++; $end_mm = $end_mm + 3 - 12; } else { $end_mm = $end_mm + 3; } $end_timestamp = strtotime($end_yy ."-". $end_mm ."-". $end_dd); $leapyear_flag = date("L", $end_timestamp); $totaldays_array = $this->array_totaldays_in_month(); $strkey = strval($end_mm); $month_totaldays = $totaldays_array[$strkey]; if ($end_mm == 2 && strval($leapyear_flag) == "1") { $month_totaldays = "29"; } $month_totaldays = intval($month_totaldays); if ($end_dd > $month_totaldays) { // if end-day is larger than total num of days in this month, set end-day to the last day of month $end_dd = $month_totaldays; } $end_timestamp = strtotime($end_yy ."-". $end_mm ."-". $end_dd); $emember_numdays = floor($timediff / $param_day_multiplier); if ($emember_numdays < 0) { $emember_numdays = 0; } else { $emember_numdays = 90 - $emember_numdays; if ($emember_numdays < 0) $emember_numdays = 0; } $stremember_finaldate = date("d-M-Y", $end_timestamp); } $strfinal_emember_numdays = $emember_numdays; // $strfinal_emember_numdays = $strvalidstart ." , ". $emember_numdays ." days"; // debug /* modified by ZY 6 Aug 2012, show - if no receipts */ if (floatval($strpointbal) <= 0) { // if no receipts / no points, change to dash $stremember_finaldate = "-"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 105
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 43
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
2 jumps found. (Code = 46) Position 1 = 68, Position 2 = 71
Branch analysis from position: 68
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 73
Branch analysis from position: 72
2 jumps found. (Code = 43) Position 1 = 77, Position 2 = 78
Branch analysis from position: 77
2 jumps found. (Code = 43) Position 1 = 93, Position 2 = 95
Branch analysis from position: 93
1 jumps found. (Code = 42) Position 1 = 100
Branch analysis from position: 100
2 jumps found. (Code = 43) Position 1 = 109, Position 2 = 110
Branch analysis from position: 109
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 110
Branch analysis from position: 95
2 jumps found. (Code = 43) Position 1 = 99, Position 2 = 100
Branch analysis from position: 99
2 jumps found. (Code = 43) Position 1 = 109, Position 2 = 110
Branch analysis from position: 109
Branch analysis from position: 110
Branch analysis from position: 100
Branch analysis from position: 78
Branch analysis from position: 73
Branch analysis from position: 71
Branch analysis from position: 43
2 jumps found. (Code = 46) Position 1 = 68, Position 2 = 71
Branch analysis from position: 68
Branch analysis from position: 71
Branch analysis from position: 16
Branch analysis from position: 105
filename:       /in/kP933
function name:  (null)
number of ops:  111
compiled vars:  !0 = $emember_numdays, !1 = $param_day_multiplier, !2 = $stremember_finaldate, !3 = $strvalidstart, !4 = $curr_timestamp, !5 = $start_timestamp, !6 = $strpointbal, !7 = $timediff, !8 = $end_yy, !9 = $end_mm, !10 = $end_dd, !11 = $end_timestamp, !12 = $leapyear_flag, !13 = $totaldays_array, !14 = $strkey, !15 = $month_totaldays, !16 = $strfinal_emember_numdays
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 0
    6     1        ASSIGN                                                   !1, 86400
    7     2        ASSIGN                                                   !2, ''
    8     3        IS_NOT_EQUAL                                             !3, ''
          4      > JMPZ                                                     ~20, ->105
    9     5    >   INIT_FCALL                                               'time'
          6        DO_ICALL                                         $21     
          7        ASSIGN                                                   !4, $21
   10     8        INIT_FCALL                                               'strtotime'
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                         $23     
         11        ASSIGN                                                   !5, $23
   11    12        CAST                                          5  ~25     !6
         13        IS_SMALLER_OR_EQUAL                                      ~25, 0
         14      > JMPZ                                                     ~26, ->16
   13    15    >   ASSIGN                                                   !5, !4
   15    16    >   SUB                                              ~28     !4, !5
         17        ASSIGN                                                   !7, ~28
   19    18        INIT_FCALL                                               'date'
         19        SEND_VAL                                                 'Y'
         20        SEND_VAR                                                 !4
         21        DO_ICALL                                         $30     
         22        CAST                                          4  ~31     $30
         23        ASSIGN                                                   !8, ~31
   20    24        INIT_FCALL                                               'date'
         25        SEND_VAL                                                 'm'
         26        SEND_VAR                                                 !4
         27        DO_ICALL                                         $33     
         28        CAST                                          4  ~34     $33
         29        ASSIGN                                                   !9, ~34
   21    30        INIT_FCALL                                               'date'
         31        SEND_VAL                                                 'd'
         32        SEND_VAR                                                 !4
         33        DO_ICALL                                         $36     
         34        CAST                                          4  ~37     $36
         35        ASSIGN                                                   !10, ~37
   22    36        IS_SMALLER_OR_EQUAL                                      10, !9
         37      > JMPZ                                                     ~39, ->43
   23    38    >   PRE_INC                                                  !8
   24    39        ADD                                              ~41     !9, 3
         40        SUB                                              ~42     ~41, 12
         41        ASSIGN                                                   !9, ~42
         42      > JMP                                                      ->45
   26    43    >   ADD                                              ~44     !9, 3
         44        ASSIGN                                                   !9, ~44
   28    45    >   INIT_FCALL                                               'strtotime'
         46        CONCAT                                           ~46     !8, '-'
         47        CONCAT                                           ~47     ~46, !9
         48        CONCAT                                           ~48     ~47, '-'
         49        CONCAT                                           ~49     ~48, !10
         50        SEND_VAL                                                 ~49
         51        DO_ICALL                                         $50     
         52        ASSIGN                                                   !11, $50
   29    53        INIT_FCALL                                               'date'
         54        SEND_VAL                                                 'L'
         55        SEND_VAR                                                 !11
         56        DO_ICALL                                         $52     
         57        ASSIGN                                                   !12, $52
   30    58        FETCH_THIS                                       $54     
         59        INIT_METHOD_CALL                                         $54, 'array_totaldays_in_month'
         60        DO_FCALL                                      0  $55     
         61        ASSIGN                                                   !13, $55
   31    62        CAST                                          6  ~57     !9
         63        ASSIGN                                                   !14, ~57
   32    64        FETCH_DIM_R                                      ~59     !13, !14
         65        ASSIGN                                                   !15, ~59
   33    66        IS_EQUAL                                         ~61     !9, 2
         67      > JMPZ_EX                                          ~61     ~61, ->71
         68    >   CAST                                          6  ~62     !12
         69        IS_EQUAL                                         ~63     ~62, '1'
         70        BOOL                                             ~61     ~63
         71    > > JMPZ                                                     ~61, ->73
   34    72    >   ASSIGN                                                   !15, '29'
   36    73    >   CAST                                          4  ~65     !15
         74        ASSIGN                                                   !15, ~65
   37    75        IS_SMALLER                                               !15, !10
         76      > JMPZ                                                     ~67, ->78
   39    77    >   ASSIGN                                                   !10, !15
   41    78    >   INIT_FCALL                                               'strtotime'
         79        CONCAT                                           ~69     !8, '-'
         80        CONCAT                                           ~70     ~69, !9
         81        CONCAT                                           ~71     ~70, '-'
         82        CONCAT                                           ~72     ~71, !10
         83        SEND_VAL                                                 ~72
         84        DO_ICALL                                         $73     
         85        ASSIGN                                                   !11, $73
   43    86        INIT_FCALL                                               'floor'
         87        DIV                                              ~75     !7, !1
         88        SEND_VAL                                                 ~75
         89        DO_ICALL                                         $76     
         90        ASSIGN                                                   !0, $76
   44    91        IS_SMALLER                                               !0, 0
         92      > JMPZ                                                     ~78, ->95
   45    93    >   ASSIGN                                                   !0, 0
         94      > JMP                                                      ->100
   47    95    >   SUB                                              ~80     90, !0
         96        ASSIGN                                                   !0, ~80
   48    97        IS_SMALLER                                               !0, 0
         98      > JMPZ                                                     ~82, ->100
         99    >   ASSIGN                                                   !0, 0
   50   100    >   INIT_FCALL                                               'date'
        101        SEND_VAL                                                 'd-M-Y'
        102        SEND_VAR                                                 !11
        103        DO_ICALL                                         $84     
        104        ASSIGN                                                   !2, $84
   52   105    >   ASSIGN                                                   !16, !0
   56   106        CAST                                          5  ~87     !6
        107        IS_SMALLER_OR_EQUAL                                      ~87, 0
        108      > JMPZ                                                     ~88, ->110
   58   109    >   ASSIGN                                                   !2, '-'
   59   110    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.91 ms | 1404 KiB | 21 Q