3v4l.org

run code in 300+ PHP versions simultaneously
<?php $paymentdate = "Wed May 13 2015 22:55:49 GMT-0400 (GMT Daylight Time)"; $start = strpos($paymentdate, "GMT"); echo $start . " start\n"; $paystr = substr($paymentdate, 0, $start); echo $paystr . " left\n"; $paystr1 = substr($paymentdate, $start); echo $paystr1 . " right\n"; $paystr2 = substr($paystr1, 3); echo $paystr2 . " offset\n"; $start1 = strpos($paystr2, "GMT"); echo $start1 . " left date string\n"; $paystr3 = substr($paystr2, 0, $start1 - 2); echo $paystr3 . " left date\n"; date_default_timezone_set('Europe/London'); $bool = date('I'); // this will be 1 in DST or else 0 echo $bool . " bool\n"; $paystr4 = substr($paystr3, 0, 1); echo $paystr4 . " offset sign\n"; $paystr5 = substr($paystr3, 1); echo $paystr5 . " offset number\n"; $paytime = strtotime($paystr); echo $paytime . " paytime\n"; $mdate = date('Y-m-d H:i:s', $paytime); echo $mdate . " mdate\n"; $dy = date("d", strtotime($mdate)); echo $dy . " dy\n"; $hr = date("H", strtotime($mdate)); echo $hr . " hr\n"; $paystr6 = substr($paystr5, 0, 2); if (intval($paystr6) > 12) { $paystr6 = substr($paystr5, 1, 1); } echo $paystr6 . " paystr6\n"; $payhr = intval($paystr6); echo $payhr . " payhr\n"; $nochange = 0; if ($paystr4 == "+") { if ($bool == 1) { if ($paystr3 == "+0100") { $nochange = 1; } if ($nochange == 0) { $change = $payhr - 1; $hr = $hr - $change; echo $paytime . " paytime\n"; $paytime = strtotime("-$change hours", $paytime); echo $paytime . " paytime\n"; if ($hr < 0) { $paytime = strtotime("-1 day", "+24 - abs($hr) hours", $paytime); echo $paytime . " paytime\n"; $dy = $dy - 1; $hr = 24 - abs($hr); } } } if ($bool == 0) { if ($paystr3 == "+0000") { $nochange = 1; } if ($nochange == 0) { $change = $payhr . " payhr\n"; $hr = $hr - $change; $paytime = strtotime("-$change hours", $paytime); if ($hr < 0) { $paytime = strtotime("-1 day", "+24 - abs($hr) hours", $paytime); $dy = $dy - 1; $hr = 24 - abs($hr); } } } } if ($paystr4 == "-") { if ($bool == 1) { $change = $payhr; echo $change . " change\n"; $hr = $hr + $change; echo $hr . " hr\n"; $paytime = strtotime("+$change hour", $paytime); if ($hr > 24) { $paytime = strtotime("+1 day", "+23 - abs($hr) hours", $paytime); $dy = $dy + 1; $hr = abs($hr) - 23; } } if ($bool == 0) { $change = $payhr; $hr = $hr + $change; $paytime = strtotime("+$change hour", $paytime); if ($hr > 24) { $paytime = strtotime("+1 day", "+24 - abs($hr) hours", $paytime); $dy = $dy + 1; $hr = abs($hr) - 24; } } } echo $change . " change\n"; echo $hr . " hr\n"; echo $dy . " dy\n"; echo $paytime . " paytime\n"; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 112, Position 2 = 118
Branch analysis from position: 112
2 jumps found. (Code = 43) Position 1 = 127, Position 2 = 207
Branch analysis from position: 127
2 jumps found. (Code = 43) Position 1 = 129, Position 2 = 170
Branch analysis from position: 129
2 jumps found. (Code = 43) Position 1 = 131, Position 2 = 132
Branch analysis from position: 131
2 jumps found. (Code = 43) Position 1 = 134, Position 2 = 170
Branch analysis from position: 134
2 jumps found. (Code = 43) Position 1 = 152, Position 2 = 170
Branch analysis from position: 152
2 jumps found. (Code = 43) Position 1 = 172, Position 2 = 207
Branch analysis from position: 172
2 jumps found. (Code = 43) Position 1 = 174, Position 2 = 175
Branch analysis from position: 174
2 jumps found. (Code = 43) Position 1 = 177, Position 2 = 207
Branch analysis from position: 177
2 jumps found. (Code = 43) Position 1 = 191, Position 2 = 207
Branch analysis from position: 191
2 jumps found. (Code = 43) Position 1 = 209, Position 2 = 275
Branch analysis from position: 209
2 jumps found. (Code = 43) Position 1 = 211, Position 2 = 244
Branch analysis from position: 211
2 jumps found. (Code = 43) Position 1 = 228, Position 2 = 244
Branch analysis from position: 228
2 jumps found. (Code = 43) Position 1 = 246, Position 2 = 275
Branch analysis from position: 246
2 jumps found. (Code = 43) Position 1 = 259, Position 2 = 275
Branch analysis from position: 259
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 275
Branch analysis from position: 275
Branch analysis from position: 244
Branch analysis from position: 244
Branch analysis from position: 275
Branch analysis from position: 207
Branch analysis from position: 207
Branch analysis from position: 175
Branch analysis from position: 207
Branch analysis from position: 170
Branch analysis from position: 170
Branch analysis from position: 132
Branch analysis from position: 170
Branch analysis from position: 207
Branch analysis from position: 118
filename:       /in/5AVff
function name:  (null)
number of ops:  284
compiled vars:  !0 = $paymentdate, !1 = $start, !2 = $paystr, !3 = $paystr1, !4 = $paystr2, !5 = $start1, !6 = $paystr3, !7 = $bool, !8 = $paystr4, !9 = $paystr5, !10 = $paytime, !11 = $mdate, !12 = $dy, !13 = $hr, !14 = $paystr6, !15 = $payhr, !16 = $nochange, !17 = $change
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Wed+May+13+2015+22%3A55%3A49+GMT-0400+%28GMT+Daylight+Time%29'
    4     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'GMT'
          4        DO_ICALL                                         $19     
          5        ASSIGN                                                   !1, $19
    5     6        CONCAT                                           ~21     !1, '+start%0A'
          7        ECHO                                                     ~21
    6     8        INIT_FCALL                                               'substr'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 0
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $22     
         13        ASSIGN                                                   !2, $22
    7    14        CONCAT                                           ~24     !2, '+left%0A'
         15        ECHO                                                     ~24
    8    16        INIT_FCALL                                               'substr'
         17        SEND_VAR                                                 !0
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $25     
         20        ASSIGN                                                   !3, $25
    9    21        CONCAT                                           ~27     !3, '+right%0A'
         22        ECHO                                                     ~27
   10    23        INIT_FCALL                                               'substr'
         24        SEND_VAR                                                 !3
         25        SEND_VAL                                                 3
         26        DO_ICALL                                         $28     
         27        ASSIGN                                                   !4, $28
   11    28        CONCAT                                           ~30     !4, '+offset%0A'
         29        ECHO                                                     ~30
   12    30        INIT_FCALL                                               'strpos'
         31        SEND_VAR                                                 !4
         32        SEND_VAL                                                 'GMT'
         33        DO_ICALL                                         $31     
         34        ASSIGN                                                   !5, $31
   13    35        CONCAT                                           ~33     !5, '+left+date+string%0A'
         36        ECHO                                                     ~33
   14    37        INIT_FCALL                                               'substr'
         38        SEND_VAR                                                 !4
         39        SEND_VAL                                                 0
         40        SUB                                              ~34     !5, 2
         41        SEND_VAL                                                 ~34
         42        DO_ICALL                                         $35     
         43        ASSIGN                                                   !6, $35
   15    44        CONCAT                                           ~37     !6, '+left+date%0A'
         45        ECHO                                                     ~37
   16    46        INIT_FCALL                                               'date_default_timezone_set'
         47        SEND_VAL                                                 'Europe%2FLondon'
         48        DO_ICALL                                                 
   17    49        INIT_FCALL                                               'date'
         50        SEND_VAL                                                 'I'
         51        DO_ICALL                                         $39     
         52        ASSIGN                                                   !7, $39
   18    53        CONCAT                                           ~41     !7, '+bool%0A'
         54        ECHO                                                     ~41
   19    55        INIT_FCALL                                               'substr'
         56        SEND_VAR                                                 !6
         57        SEND_VAL                                                 0
         58        SEND_VAL                                                 1
         59        DO_ICALL                                         $42     
         60        ASSIGN                                                   !8, $42
   20    61        CONCAT                                           ~44     !8, '+offset+sign%0A'
         62        ECHO                                                     ~44
   21    63        INIT_FCALL                                               'substr'
         64        SEND_VAR                                                 !6
         65        SEND_VAL                                                 1
         66        DO_ICALL                                         $45     
         67        ASSIGN                                                   !9, $45
   22    68        CONCAT                                           ~47     !9, '+offset+number%0A'
         69        ECHO                                                     ~47
   23    70        INIT_FCALL                                               'strtotime'
         71        SEND_VAR                                                 !2
         72        DO_ICALL                                         $48     
         73        ASSIGN                                                   !10, $48
   24    74        CONCAT                                           ~50     !10, '+paytime%0A'
         75        ECHO                                                     ~50
   25    76        INIT_FCALL                                               'date'
         77        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
         78        SEND_VAR                                                 !10
         79        DO_ICALL                                         $51     
         80        ASSIGN                                                   !11, $51
   26    81        CONCAT                                           ~53     !11, '+mdate%0A'
         82        ECHO                                                     ~53
   27    83        INIT_FCALL                                               'date'
         84        SEND_VAL                                                 'd'
         85        INIT_FCALL                                               'strtotime'
         86        SEND_VAR                                                 !11
         87        DO_ICALL                                         $54     
         88        SEND_VAR                                                 $54
         89        DO_ICALL                                         $55     
         90        ASSIGN                                                   !12, $55
   28    91        CONCAT                                           ~57     !12, '+dy%0A'
         92        ECHO                                                     ~57
   29    93        INIT_FCALL                                               'date'
         94        SEND_VAL                                                 'H'
         95        INIT_FCALL                                               'strtotime'
         96        SEND_VAR                                                 !11
         97        DO_ICALL                                         $58     
         98        SEND_VAR                                                 $58
         99        DO_ICALL                                         $59     
        100        ASSIGN                                                   !13, $59
   30   101        CONCAT                                           ~61     !13, '+hr%0A'
        102        ECHO                                                     ~61
   31   103        INIT_FCALL                                               'substr'
        104        SEND_VAR                                                 !9
        105        SEND_VAL                                                 0
        106        SEND_VAL                                                 2
        107        DO_ICALL                                         $62     
        108        ASSIGN                                                   !14, $62
   32   109        CAST                                          4  ~64     !14
        110        IS_SMALLER                                               12, ~64
        111      > JMPZ                                                     ~65, ->118
   34   112    >   INIT_FCALL                                               'substr'
        113        SEND_VAR                                                 !9
        114        SEND_VAL                                                 1
        115        SEND_VAL                                                 1
        116        DO_ICALL                                         $66     
        117        ASSIGN                                                   !14, $66
   36   118    >   CONCAT                                           ~68     !14, '+paystr6%0A'
        119        ECHO                                                     ~68
   37   120        CAST                                          4  ~69     !14
        121        ASSIGN                                                   !15, ~69
   38   122        CONCAT                                           ~71     !15, '+payhr%0A'
        123        ECHO                                                     ~71
   39   124        ASSIGN                                                   !16, 0
   40   125        IS_EQUAL                                                 !8, '%2B'
        126      > JMPZ                                                     ~73, ->207
   42   127    >   IS_EQUAL                                                 !7, 1
        128      > JMPZ                                                     ~74, ->170
   44   129    >   IS_EQUAL                                                 !6, '%2B0100'
        130      > JMPZ                                                     ~75, ->132
   46   131    >   ASSIGN                                                   !16, 1
   48   132    >   IS_EQUAL                                                 !16, 0
        133      > JMPZ                                                     ~77, ->170
   50   134    >   SUB                                              ~78     !15, 1
        135        ASSIGN                                                   !17, ~78
   51   136        SUB                                              ~80     !13, !17
        137        ASSIGN                                                   !13, ~80
   52   138        CONCAT                                           ~82     !10, '+paytime%0A'
        139        ECHO                                                     ~82
   53   140        INIT_FCALL                                               'strtotime'
        141        ROPE_INIT                                     3  ~84     '-'
        142        ROPE_ADD                                      1  ~84     ~84, !17
        143        ROPE_END                                      2  ~83     ~84, '+hours'
        144        SEND_VAL                                                 ~83
        145        SEND_VAR                                                 !10
        146        DO_ICALL                                         $86     
        147        ASSIGN                                                   !10, $86
   54   148        CONCAT                                           ~88     !10, '+paytime%0A'
        149        ECHO                                                     ~88
   55   150        IS_SMALLER                                               !13, 0
        151      > JMPZ                                                     ~89, ->170
   57   152    >   INIT_FCALL                                               'strtotime'
        153        SEND_VAL                                                 '-1+day'
        154        ROPE_INIT                                     3  ~91     '%2B24+-+abs%28'
        155        ROPE_ADD                                      1  ~91     ~91, !13
        156        ROPE_END                                      2  ~90     ~91, '%29+hours'
        157        SEND_VAL                                                 ~90
        158        SEND_VAR                                                 !10
        159        DO_ICALL                                         $93     
        160        ASSIGN                                                   !10, $93
   58   161        CONCAT                                           ~95     !10, '+paytime%0A'
        162        ECHO                                                     ~95
   59   163        SUB                                              ~96     !12, 1
        164        ASSIGN                                                   !12, ~96
   60   165        INIT_FCALL                                               'abs'
        166        SEND_VAR                                                 !13
        167        DO_ICALL                                         $98     
        168        SUB                                              ~99     24, $98
        169        ASSIGN                                                   !13, ~99
   64   170    >   IS_EQUAL                                                 !7, 0
        171      > JMPZ                                                     ~101, ->207
   66   172    >   IS_EQUAL                                                 !6, '%2B0000'
        173      > JMPZ                                                     ~102, ->175
   68   174    >   ASSIGN                                                   !16, 1
   70   175    >   IS_EQUAL                                                 !16, 0
        176      > JMPZ                                                     ~104, ->207
   72   177    >   CONCAT                                           ~105    !15, '+payhr%0A'
        178        ASSIGN                                                   !17, ~105
   73   179        SUB                                              ~107    !13, !17
        180        ASSIGN                                                   !13, ~107
   74   181        INIT_FCALL                                               'strtotime'
        182        ROPE_INIT                                     3  ~110    '-'
        183        ROPE_ADD                                      1  ~110    ~110, !17
        184        ROPE_END                                      2  ~109    ~110, '+hours'
        185        SEND_VAL                                                 ~109
        186        SEND_VAR                                                 !10
        187        DO_ICALL                                         $112    
        188        ASSIGN                                                   !10, $112
   75   189        IS_SMALLER                                               !13, 0
        190      > JMPZ                                                     ~114, ->207
   77   191    >   INIT_FCALL                                               'strtotime'
        192        SEND_VAL                                                 '-1+day'
        193        ROPE_INIT                                     3  ~116    '%2B24+-+abs%28'
        194        ROPE_ADD                                      1  ~116    ~116, !13
        195        ROPE_END                                      2  ~115    ~116, '%29+hours'
        196        SEND_VAL                                                 ~115
        197        SEND_VAR                                                 !10
        198        DO_ICALL                                         $118    
        199        ASSIGN                                                   !10, $118
   78   200        SUB                                              ~120    !12, 1
        201        ASSIGN                                                   !12, ~120
   79   202        INIT_FCALL                                               'abs'
        203        SEND_VAR                                                 !13
        204        DO_ICALL                                         $122    
        205        SUB                                              ~123    24, $122
        206        ASSIGN                                                   !13, ~123
   84   207    >   IS_EQUAL                                                 !8, '-'
        208      > JMPZ                                                     ~125, ->275
   86   209    >   IS_EQUAL                                                 !7, 1
        210      > JMPZ                                                     ~126, ->244
   88   211    >   ASSIGN                                                   !17, !15
   89   212        CONCAT                                           ~128    !17, '+change%0A'
        213        ECHO                                                     ~128
   90   214        ADD                                              ~129    !13, !17
        215        ASSIGN                                                   !13, ~129
   91   216        CONCAT                                           ~131    !13, '+hr%0A'
        217        ECHO                                                     ~131
   92   218        INIT_FCALL                                               'strtotime'
        219        ROPE_INIT                                     3  ~133    '%2B'
        220        ROPE_ADD                                      1  ~133    ~133, !17
        221        ROPE_END                                      2  ~132    ~133, '+hour'
        222        SEND_VAL                                                 ~132
        223        SEND_VAR                                                 !10
        224        DO_ICALL                                         $135    
        225        ASSIGN                                                   !10, $135
   93   226        IS_SMALLER                                               24, !13
        227      > JMPZ                                                     ~137, ->244
   95   228    >   INIT_FCALL                                               'strtotime'
        229        SEND_VAL                                                 '%2B1+day'
        230        ROPE_INIT                                     3  ~139    '%2B23+-+abs%28'
        231        ROPE_ADD                                      1  ~139    ~139, !13
        232        ROPE_END                                      2  ~138    ~139, '%29+hours'
        233        SEND_VAL                                                 ~138
        234        SEND_VAR                                                 !10
        235        DO_ICALL                                         $141    
        236        ASSIGN                                                   !10, $141
   96   237        ADD                                              ~143    !12, 1
        238        ASSIGN                                                   !12, ~143
   97   239        INIT_FCALL                                               'abs'
        240        SEND_VAR                                                 !13
        241        DO_ICALL                                         $145    
        242        SUB                                              ~146    $145, 23
        243        ASSIGN                                                   !13, ~146
  100   244    >   IS_EQUAL                                                 !7, 0
        245      > JMPZ                                                     ~148, ->275
  102   246    >   ASSIGN                                                   !17, !15
  103   247        ADD                                              ~150    !13, !17
        248        ASSIGN                                                   !13, ~150
  104   249        INIT_FCALL                                               'strtotime'
        250        ROPE_INIT                                     3  ~153    '%2B'
        251        ROPE_ADD                                      1  ~153    ~153, !17
        252        ROPE_END                                      2  ~152    ~153, '+hour'
        253        SEND_VAL                                                 ~152
        254        SEND_VAR                                                 !10
        255        DO_ICALL                                         $155    
        256        ASSIGN                                                   !10, $155
  105   257        IS_SMALLER                                               24, !13
        258      > JMPZ                                                     ~157, ->275
  107   259    >   INIT_FCALL                                               'strtotime'
        260        SEND_VAL                                                 '%2B1+day'
        261        ROPE_INIT                                     3  ~159    '%2B24+-+abs%28'
        262        ROPE_ADD                                      1  ~159    ~159, !13
        263        ROPE_END                                      2  ~158    ~159, '%29+hours'
        264        SEND_VAL                                                 ~158
        265        SEND_VAR                                                 !10
        266        DO_ICALL                                         $161    
        267        ASSIGN                                                   !10, $161
  108   268        ADD                                              ~163    !12, 1
        269        ASSIGN                                                   !12, ~163
  109   270        INIT_FCALL                                               'abs'
        271        SEND_VAR                                                 !13
        272        DO_ICALL                                         $165    
        273        SUB                                              ~166    $165, 24
        274        ASSIGN                                                   !13, ~166
  113   275    >   CONCAT                                           ~168    !17, '+change%0A'
        276        ECHO                                                     ~168
  114   277        CONCAT                                           ~169    !13, '+hr%0A'
        278        ECHO                                                     ~169
  115   279        CONCAT                                           ~170    !12, '+dy%0A'
        280        ECHO                                                     ~170
  116   281        CONCAT                                           ~171    !10, '+paytime%0A'
        282        ECHO                                                     ~171
  117   283      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.38 ms | 1420 KiB | 25 Q