3v4l.org

run code in 300+ PHP versions simultaneously
<?php $paymentdate = "Sat May 16 2015 07:55:49 GMT+0400 (GMT Daylight Time)"; $start = strpos($paymentdate, "GMT"); echo $start . "\n"; $paystr = substr($paymentdate, 0, $start); echo $paystr . "\n"; $paystr1 = substr($paymentdate, $start); echo $paystr1 . "\n"; $paystr2 = substr($paystr1, 3); echo $paystr2 . "\n"; $start1 = strpos($paystr2, "GMT"); echo $start1 . "\n"; $paystr3 = substr($paystr2, 0, $start1 - 2); echo $paystr3 . "\n"; date_default_timezone_set('Europe/London'); $bool = date('I'); // this will be 1 in DST or else 0 echo $bool . "\n"; $paystr4 = substr($paystr3, 0, 1); echo $paystr4 . "\n"; $paystr5 = substr($paystr4, 1); echo $paystr5 . "\n"; $paytime = strtotime($paystr); echo $paytime . "\n"; $mdate = date('Y-m-d h:i:s', $paytime); echo $mdate . "\n"; $dy = date("d", strtotime($mdate)); echo $dy . "\n"; $hr = date("h", strtotime($mdate)); echo $hr . "\n"; $paystr6 = substr($paystr5, 0, 2); if (intval($paystr6) > 12) { $paystr6 = substr($paystr5, 1, 1); } echo $paystr6 . "\n"; $payhr = intval($paystr6); echo $payhr . "\n"; $nochange = 0; if ($paystr4 == "+") { if ($bool == 1) { if ($paystr3 == "+0100") { $nochange = 1; } if ($nochange == 0) { $change = $payhr - 1; } } if ($bool == 0) { if ($paystr3 == "+0000") { $nochange = 1; } if ($nochange == 0) { $change = $payhr; } } } if ($paystr4 == "-") { if ($bool == 1) { $change = 13 - $payhr; } if ($bool == 0) { $change = 12 - $payhr; } } echo $change . "\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 = 144
Branch analysis from position: 127
2 jumps found. (Code = 43) Position 1 = 129, Position 2 = 136
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 = 136
Branch analysis from position: 134
2 jumps found. (Code = 43) Position 1 = 138, Position 2 = 144
Branch analysis from position: 138
2 jumps found. (Code = 43) Position 1 = 140, Position 2 = 141
Branch analysis from position: 140
2 jumps found. (Code = 43) Position 1 = 143, Position 2 = 144
Branch analysis from position: 143
2 jumps found. (Code = 43) Position 1 = 146, Position 2 = 154
Branch analysis from position: 146
2 jumps found. (Code = 43) Position 1 = 148, Position 2 = 150
Branch analysis from position: 148
2 jumps found. (Code = 43) Position 1 = 152, Position 2 = 154
Branch analysis from position: 152
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 154
Branch analysis from position: 150
Branch analysis from position: 154
Branch analysis from position: 144
Branch analysis from position: 141
Branch analysis from position: 144
Branch analysis from position: 136
Branch analysis from position: 132
Branch analysis from position: 136
Branch analysis from position: 144
Branch analysis from position: 118
filename:       /in/MZ1al
function name:  (null)
number of ops:  157
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, 'Sat+May+16+2015+07%3A55%3A49+GMT%2B0400+%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, '%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, '%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, '%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, '%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, '%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, '%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, '%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, '%0A'
         62        ECHO                                                     ~44
   21    63        INIT_FCALL                                               'substr'
         64        SEND_VAR                                                 !8
         65        SEND_VAL                                                 1
         66        DO_ICALL                                         $45     
         67        ASSIGN                                                   !9, $45
   22    68        CONCAT                                           ~47     !9, '%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, '%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, '%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, '%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, '%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, '%0A'
        119        ECHO                                                     ~68
   37   120        CAST                                          4  ~69     !14
        121        ASSIGN                                                   !15, ~69
   38   122        CONCAT                                           ~71     !15, '%0A'
        123        ECHO                                                     ~71
   39   124        ASSIGN                                                   !16, 0
   40   125        IS_EQUAL                                                 !8, '%2B'
        126      > JMPZ                                                     ~73, ->144
   42   127    >   IS_EQUAL                                                 !7, 1
        128      > JMPZ                                                     ~74, ->136
   44   129    >   IS_EQUAL                                                 !6, '%2B0100'
        130      > JMPZ                                                     ~75, ->132
   46   131    >   ASSIGN                                                   !16, 1
   48   132    >   IS_EQUAL                                                 !16, 0
        133      > JMPZ                                                     ~77, ->136
   50   134    >   SUB                                              ~78     !15, 1
        135        ASSIGN                                                   !17, ~78
   53   136    >   IS_EQUAL                                                 !7, 0
        137      > JMPZ                                                     ~80, ->144
   55   138    >   IS_EQUAL                                                 !6, '%2B0000'
        139      > JMPZ                                                     ~81, ->141
   57   140    >   ASSIGN                                                   !16, 1
   59   141    >   IS_EQUAL                                                 !16, 0
        142      > JMPZ                                                     ~83, ->144
   61   143    >   ASSIGN                                                   !17, !15
   65   144    >   IS_EQUAL                                                 !8, '-'
        145      > JMPZ                                                     ~85, ->154
   67   146    >   IS_EQUAL                                                 !7, 1
        147      > JMPZ                                                     ~86, ->150
   69   148    >   SUB                                              ~87     13, !15
        149        ASSIGN                                                   !17, ~87
   71   150    >   IS_EQUAL                                                 !7, 0
        151      > JMPZ                                                     ~89, ->154
   73   152    >   SUB                                              ~90     12, !15
        153        ASSIGN                                                   !17, ~90
   76   154    >   CONCAT                                           ~92     !17, '%0A'
        155        ECHO                                                     ~92
        156      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.11 ms | 1400 KiB | 23 Q