3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL ^ E_NOTICE); ?> <?php if($_GET['submit'] && $_GET['category'] && $_GET['Manufacture']) { //Check whether user presses submit button, enter month, date, year, and category //Ready to get all data needed $start_month= $_GET['month']; $start_date= $_GET['date']; $start_year= $_GET['year']; $year_mfg= $_GET['Manufacture']; $CY=date("jFy", strtotime("-3 Years")); $fromDate = date("jFy", strtotime("-3 Years")); $Cu=date('j-F-Y'); $I=$S-2; $S=date('Y'); $Q=$S-$year_mfg; if(!checkdate($start_month, $start_date, $start_year)){ //IS inputted data valid? $continue = "NO"; } else { $continue = "YES"; }; if($continue == "NO"){ if($Q<=1) { echo '<center>'; echo '<img src="images/IIN.PNG">'; echo "</br>"; echo '<a href="index.php"><img src="images/refresh1.png"></a>'; } else { echo'<center>'; echo '<img src="images/OOW.PNG">'; echo "</br>"; echo '<a href="index.php"><img src="images/refresh2.png"></a>'; }; } } if($continue == "YES"){ $category = $_GET['category']; echo $Cu; echo "<br />"; echo "<h1>Date of Purchase: "; echo $start_dmy = $start_date . "-" . $start_month. "-". $start_year; echo "<h1>Year of Manufacturing: "; echo $year_mfg; echo "<br />"; if($category == 0){ // if user selects "Not listed" then... echo "ohh, I'll check whether u fill all the blanks :) <br/>"; $len_int = $_GET['int']; if(!$len_int) { $len_int = 0; } } else { switch ($category) { case 1: // driving vroom vroom... { $date_modifier = "+2 year"; break; } case 2: // office licensing { $date_modifier = "-2 year"; break; } case 3: //tax certifications { $date_modifier = "+90 days"; } } //Guess this would be enough. for now... } $final_dmy = $start_dmy . $date_modifier; $final_dmy = strtotime ($final_dmy); echo "<br />"; // now we should combine it echo "Customer's Free Support Ends: "; echo $final_dmy = date("j-F-Y", $final_dmy); //finally,. converts the date back to the d F Y format.... e.g.: 08 April 2012 echo "</br>"; echo "</br>"; echo $Q; echo "</br>"; echo "</br>"; echo $Cu; echo "</br>"; echo $final_dmy; echo "</br>"; echo "</br>"; echo $Cu*2; echo "</br>"; echo $Cu-2; echo "<center>"; if ($final_dmy >= $Cu){ // if user selects "Not listed" then... echo $Cu; echo "</br>"; echo $final_dmy; echo 'Inn'; echo "</br>"; echo 'OOW'; echo "</br>"; }elseif($Q<=1){ echo $Cu; echo "</br>"; echo $final_dmy; echo '<img src="images/OOW.PNG">'; echo "</br>"; echo 'OOW'; echo "</br>"; } } ?>
Output for 4.3.0 - 7.1.0