3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $startDate = date('F d, Y'); $AdExpirationDate = date("F d, Y",strtotime($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 = True; }else{ $Expire30 = False; } echo $Expire30; ?>
Output for 5.0.4 - 7.2.0
Notice: Undefined variable: years in /in/Tmvt8 on line 12 Notice: Undefined variable: months in /in/Tmvt8 on line 12
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: years in /in/Tmvt8 on line 12 Notice: Undefined variable: months in /in/Tmvt8 on line 12