3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php define('DAY', 24*60*60, true); $startDate = date('F d, Y'); $AdExpirationDate = 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($AdExpirationDate - strtotime($today)); $DaysToExpiration = floor($DayDiff / DAY); if ($DaysToExpiration <= 30) { $Expire30 = true; }else{ $Expire30 = false; } echo $DaysToExpiration ." - "; if($Expire30) { echo "true"; } else { echo "false"; } ?>
Output for 4.3.0 - 5.6.28, 7.0.0 - 7.1.0
119 - false
Output for hhvm-3.10.0 - 3.12.0
Warning: Case insensitive constant names are not supported in HipHop in /in/qkLE6 on line 3 119 - false