3v4l.org

run code in 300+ PHP versions simultaneously
<?php require("db.php"); mysql_connect($DBserver, $DBuser, $DBpass) or die(mysql_error()); mysql_select_db($DBname) or die(mysql_error()); // Get data from the "CRFAds" table $result = mysql_query("SELECT * FROM CRFAds WHERE SubmitterName Like 'David%'") or die(mysql_error()); // Keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { //Get Ad Start Date $AdStartDate = date("F d, Y",strtotime($row['StartDate'])); //Check to see if it is either new (expires in 90 days) or a renewal (expires in 120 days) If ($row['NewOrRenewal']=="Renewal") { $AdExpirationDate = date("F d, Y",strtotime($row['StartDate'] . '+120 days')); //Calculate the difference between expiration date and today to see if it expires within 30 days $today = date("F d, Y"); $DayDiff = abs(strtotime($AdExpirationDate) - strtotime($today)); $DaysToExpiration = floor(($DayDiff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24)); if ($DaysToExpiration <= 30) { $Expire30 = "Yes"; }else{ $Expire30 = "No"; } }else{ $AdExpirationDate = date("F d, Y",strtotime($row['StartDate'] . '+90 days')); //Calculate the difference between expiration date and today to see if it expires within 30 days $today = date("F d, Y"); $DayDiff1 = abs(strtotime($AdExpirationDate) - strtotime($today)); $DaysToExpiration = floor(($DayDiff1- $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24)); if ($DaysToExpiration <= 30) { $Expire30 = "Yes"; }else{ $Expire30 = "No"; } } //Calculate the difference between today and start date to see if it is new within the last 30 days $DayDiff2 = abs(strtotime($AdStartDate) - strtotime($today)); $DaysRunning = floor(($DayDiff2- $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24)); if ($DaysRunning <= 30) { $New30 = "Yes"; }else{ $New30 = "No"; } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 47) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 47) Position 1 = 24, Position 2 = 28
Branch analysis from position: 24
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 163
Branch analysis from position: 163
2 jumps found. (Code = 44) Position 1 = 168, Position 2 = 29
Branch analysis from position: 168
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 87
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 83, Position 2 = 85
Branch analysis from position: 83
1 jumps found. (Code = 42) Position 1 = 86
Branch analysis from position: 86
1 jumps found. (Code = 42) Position 1 = 132
Branch analysis from position: 132
2 jumps found. (Code = 43) Position 1 = 160, Position 2 = 162
Branch analysis from position: 160
1 jumps found. (Code = 42) Position 1 = 163
Branch analysis from position: 163
Branch analysis from position: 162
2 jumps found. (Code = 44) Position 1 = 168, Position 2 = 29
Branch analysis from position: 168
Branch analysis from position: 29
Branch analysis from position: 85
1 jumps found. (Code = 42) Position 1 = 132
Branch analysis from position: 132
Branch analysis from position: 87
2 jumps found. (Code = 43) Position 1 = 129, Position 2 = 131
Branch analysis from position: 129
1 jumps found. (Code = 42) Position 1 = 132
Branch analysis from position: 132
Branch analysis from position: 131
2 jumps found. (Code = 43) Position 1 = 160, Position 2 = 162
Branch analysis from position: 160
Branch analysis from position: 162
filename:       /in/PI9Ln
function name:  (null)
number of ops:  169
compiled vars:  !0 = $DBserver, !1 = $DBuser, !2 = $DBpass, !3 = $DBname, !4 = $result, !5 = $AdStartDate, !6 = $row, !7 = $AdExpirationDate, !8 = $today, !9 = $DayDiff, !10 = $DaysToExpiration, !11 = $years, !12 = $months, !13 = $Expire30, !14 = $DayDiff1, !15 = $DayDiff2, !16 = $DaysRunning, !17 = $New30
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INCLUDE_OR_EVAL                                          'db.php', REQUIRE
    3     1        INIT_FCALL_BY_NAME                                       'mysql_connect'
          2        SEND_VAR_EX                                              !0
          3        SEND_VAR_EX                                              !1
          4        SEND_VAR_EX                                              !2
          5        DO_FCALL                                      0  $19     
          6      > JMPNZ_EX                                         ~20     $19, ->11
          7    >   INIT_FCALL_BY_NAME                                       'mysql_error'
          8        DO_FCALL                                      0  $21     
          9      > EXIT                                                     $21
         10*       BOOL                                             ~20     <true>
    4    11    >   INIT_FCALL_BY_NAME                                       'mysql_select_db'
         12        SEND_VAR_EX                                              !3
         13        DO_FCALL                                      0  $22     
         14      > JMPNZ_EX                                         ~23     $22, ->19
         15    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         16        DO_FCALL                                      0  $24     
         17      > EXIT                                                     $24
         18*       BOOL                                             ~23     <true>
    7    19    >   INIT_FCALL_BY_NAME                                       'mysql_query'
         20        SEND_VAL_EX                                              'SELECT+%2A+FROM+CRFAds+WHERE+SubmitterName+Like+%27David%25%27'
         21        DO_FCALL                                      0  $25     
         22        ASSIGN                                           ~26     !4, $25
         23      > JMPNZ_EX                                         ~26     ~26, ->28
    8    24    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         25        DO_FCALL                                      0  $27     
         26      > EXIT                                                     $27
         27*       BOOL                                             ~26     <true>
   11    28    > > JMP                                                      ->163
   14    29    >   INIT_FCALL                                               'date'
         30        SEND_VAL                                                 'F+d%2C+Y'
         31        INIT_FCALL                                               'strtotime'
         32        FETCH_DIM_R                                      ~28     !6, 'StartDate'
         33        SEND_VAL                                                 ~28
         34        DO_ICALL                                         $29     
         35        SEND_VAR                                                 $29
         36        DO_ICALL                                         $30     
         37        ASSIGN                                                   !5, $30
   17    38        FETCH_DIM_R                                      ~32     !6, 'NewOrRenewal'
         39        IS_EQUAL                                                 ~32, 'Renewal'
         40      > JMPZ                                                     ~33, ->87
   18    41    >   INIT_FCALL                                               'date'
         42        SEND_VAL                                                 'F+d%2C+Y'
         43        INIT_FCALL                                               'strtotime'
         44        FETCH_DIM_R                                      ~34     !6, 'StartDate'
         45        CONCAT                                           ~35     ~34, '%2B120+days'
         46        SEND_VAL                                                 ~35
         47        DO_ICALL                                         $36     
         48        SEND_VAR                                                 $36
         49        DO_ICALL                                         $37     
         50        ASSIGN                                                   !7, $37
   21    51        INIT_FCALL                                               'date'
         52        SEND_VAL                                                 'F+d%2C+Y'
         53        DO_ICALL                                         $39     
         54        ASSIGN                                                   !8, $39
   22    55        INIT_FCALL                                               'abs'
         56        INIT_FCALL                                               'strtotime'
         57        SEND_VAR                                                 !7
         58        DO_ICALL                                         $41     
         59        INIT_FCALL                                               'strtotime'
         60        SEND_VAR                                                 !8
         61        DO_ICALL                                         $42     
         62        SUB                                              ~43     $41, $42
         63        SEND_VAL                                                 ~43
         64        DO_ICALL                                         $44     
         65        ASSIGN                                                   !9, $44
   23    66        INIT_FCALL                                               'floor'
         67        MUL                                              ~46     !11, 365
         68        MUL                                              ~47     ~46, 60
         69        MUL                                              ~48     ~47, 60
         70        MUL                                              ~49     ~48, 24
         71        SUB                                              ~50     !9, ~49
         72        MUL                                              ~51     !12, 30
         73        MUL                                              ~52     ~51, 60
         74        MUL                                              ~53     ~52, 60
         75        MUL                                              ~54     ~53, 24
         76        SUB                                              ~55     ~50, ~54
         77        DIV                                              ~56     ~55, 86400
         78        SEND_VAL                                                 ~56
         79        DO_ICALL                                         $57     
         80        ASSIGN                                                   !10, $57
   24    81        IS_SMALLER_OR_EQUAL                                      !10, 30
         82      > JMPZ                                                     ~59, ->85
   25    83    >   ASSIGN                                                   !13, 'Yes'
         84      > JMP                                                      ->86
   27    85    >   ASSIGN                                                   !13, 'No'
         86    > > JMP                                                      ->132
   31    87    >   INIT_FCALL                                               'date'
         88        SEND_VAL                                                 'F+d%2C+Y'
         89        INIT_FCALL                                               'strtotime'
         90        FETCH_DIM_R                                      ~62     !6, 'StartDate'
         91        CONCAT                                           ~63     ~62, '%2B90+days'
         92        SEND_VAL                                                 ~63
         93        DO_ICALL                                         $64     
         94        SEND_VAR                                                 $64
         95        DO_ICALL                                         $65     
         96        ASSIGN                                                   !7, $65
   34    97        INIT_FCALL                                               'date'
         98        SEND_VAL                                                 'F+d%2C+Y'
         99        DO_ICALL                                         $67     
        100        ASSIGN                                                   !8, $67
   35   101        INIT_FCALL                                               'abs'
        102        INIT_FCALL                                               'strtotime'
        103        SEND_VAR                                                 !7
        104        DO_ICALL                                         $69     
        105        INIT_FCALL                                               'strtotime'
        106        SEND_VAR                                                 !8
        107        DO_ICALL                                         $70     
        108        SUB                                              ~71     $69, $70
        109        SEND_VAL                                                 ~71
        110        DO_ICALL                                         $72     
        111        ASSIGN                                                   !14, $72
   36   112        INIT_FCALL                                               'floor'
        113        MUL                                              ~74     !11, 365
        114        MUL                                              ~75     ~74, 60
        115        MUL                                              ~76     ~75, 60
        116        MUL                                              ~77     ~76, 24
        117        SUB                                              ~78     !14, ~77
        118        MUL                                              ~79     !12, 30
        119        MUL                                              ~80     ~79, 60
        120        MUL                                              ~81     ~80, 60
        121        MUL                                              ~82     ~81, 24
        122        SUB                                              ~83     ~78, ~82
        123        DIV                                              ~84     ~83, 86400
        124        SEND_VAL                                                 ~84
        125        DO_ICALL                                         $85     
        126        ASSIGN                                                   !10, $85
   37   127        IS_SMALLER_OR_EQUAL                                      !10, 30
        128      > JMPZ                                                     ~87, ->131
   38   129    >   ASSIGN                                                   !13, 'Yes'
        130      > JMP                                                      ->132
   40   131    >   ASSIGN                                                   !13, 'No'
   45   132    >   INIT_FCALL                                               'abs'
        133        INIT_FCALL                                               'strtotime'
        134        SEND_VAR                                                 !5
        135        DO_ICALL                                         $90     
        136        INIT_FCALL                                               'strtotime'
        137        SEND_VAR                                                 !8
        138        DO_ICALL                                         $91     
        139        SUB                                              ~92     $90, $91
        140        SEND_VAL                                                 ~92
        141        DO_ICALL                                         $93     
        142        ASSIGN                                                   !15, $93
   46   143        INIT_FCALL                                               'floor'
        144        MUL                                              ~95     !11, 365
        145        MUL                                              ~96     ~95, 60
        146        MUL                                              ~97     ~96, 60
        147        MUL                                              ~98     ~97, 24
        148        SUB                                              ~99     !15, ~98
        149        MUL                                              ~100    !12, 30
        150        MUL                                              ~101    ~100, 60
        151        MUL                                              ~102    ~101, 60
        152        MUL                                              ~103    ~102, 24
        153        SUB                                              ~104    ~99, ~103
        154        DIV                                              ~105    ~104, 86400
        155        SEND_VAL                                                 ~105
        156        DO_ICALL                                         $106    
        157        ASSIGN                                                   !16, $106
   47   158        IS_SMALLER_OR_EQUAL                                      !16, 30
        159      > JMPZ                                                     ~108, ->162
   48   160    >   ASSIGN                                                   !17, 'Yes'
        161      > JMP                                                      ->163
   50   162    >   ASSIGN                                                   !17, 'No'
   11   163    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
        164        SEND_VAR_EX                                              !4
        165        DO_FCALL                                      0  $111    
        166        ASSIGN                                           ~112    !6, $111
        167      > JMPNZ                                                    ~112, ->29
   54   168    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.47 ms | 1412 KiB | 21 Q