3v4l.org

run code in 300+ PHP versions simultaneously
<?php ////DISPLAY DATE OF NEXT COUNCIL MEETING//// $now = date('U'); //get current time $firstTues = strtotime("-1 month first Tuesday 4pm"); //get first Tuesday of the month $secondTues = strtotime("-1 month second Tuesday 5pm"); //get second Tuesday of the month $fourthTues = strtotime("-1 month fourth Tuesday 5pm"); //get forth Tuesday of the month $nextTues = strtotime("first Tuesday 4pm"); //get first Tuesday of next month function nextCouncilMeeting() { //If todays date less than 1st Tuesday at 11pm, display date for 1st Tuesday 4pm. if ($now < $firstTues) { echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A', $firstTues); } //If todays date greater than 1st Tuesday 5pm and less than 2nd Tuesday 11pm, display date for 2nd Tuesday 5pm elseif ($now > $firstTues and $now < $secondTues) { echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A', $secondTues); } //If todays date greater than 2nd Tuesday 5pm and less that 4th Tuesday 11pm, display date for 4th Tuesday 5pm elseif ($now > $secondTues and $now < $fourthTues) { echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A', $fourthTues); } //If todays date greater than 4th Tuesday elseif ($now > $fourthTues){ echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A', $nextTues); } else{ echo "foobar"; } } ?> <!DOCTYPE html> <html> <head> </head> <body> <p id="test"> Current Time: <?php echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A',$now); echo " " . $now;?></br> First Tuesday: <?php echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A',$firstTues);echo " " . $firstTues;?></br> Second Tuesday: <?php echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A',$secondTues);echo " " . $secondTues;?></br> Fourth Tuesday: <?php echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A',$fourthTues);echo " " . $fourthTues;?></br> Next Month First Tuesday: <?php echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A',$nextTues);echo " " . $nextTues;?> </p> <h2>Next Council Meeting:</h2> <h1><?php nextCouncilMeeting()?></h1> </body> </html>
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
<!DOCTYPE html> <html> <head> </head> <body> <p id="test"> Current Time: July 28<sup>th</sup> at 8:16 PM 1469729790</br> First Tuesday: July 2<sup>nd</sup> at 4:00 PM 1467468000</br> Second Tuesday: July 9<sup>th</sup> at 5:00 PM 1468076400</br> Fourth Tuesday: July 23<sup>rd</sup> at 5:00 PM 1469286000</br> Next Month First Tuesday: August 2<sup>nd</sup> at 4:00 PM 1470146400</p> <h2>Next Council Meeting:</h2> <h1> Warning: Undefined variable $now in /in/pkDRc on line 13 Warning: Undefined variable $firstTues in /in/pkDRc on line 13 Warning: Undefined variable $firstTues in /in/pkDRc on line 18 Warning: Undefined variable $now in /in/pkDRc on line 18 Warning: Undefined variable $secondTues in /in/pkDRc on line 23 Warning: Undefined variable $now in /in/pkDRc on line 23 Warning: Undefined variable $fourthTues in /in/pkDRc on line 28 Warning: Undefined variable $now in /in/pkDRc on line 28 foobar</h1> </body> </html>
Output for 8.0.13
<!DOCTYPE html> <html> <head> </head> <body> <p id="test"> Current Time: July 28<sup>th</sup> at 6:16 PM 1469729790</br> First Tuesday: July 2<sup>nd</sup> at 4:00 PM 1467475200</br> Second Tuesday: July 9<sup>th</sup> at 5:00 PM 1468083600</br> Fourth Tuesday: July 23<sup>rd</sup> at 5:00 PM 1469293200</br> Next Month First Tuesday: August 2<sup>nd</sup> at 4:00 PM 1470153600</p> <h2>Next Council Meeting:</h2> <h1> Warning: Undefined variable $now in /in/pkDRc on line 13 Warning: Undefined variable $firstTues in /in/pkDRc on line 13 Warning: Undefined variable $firstTues in /in/pkDRc on line 18 Warning: Undefined variable $now in /in/pkDRc on line 18 Warning: Undefined variable $secondTues in /in/pkDRc on line 23 Warning: Undefined variable $now in /in/pkDRc on line 23 Warning: Undefined variable $fourthTues in /in/pkDRc on line 28 Warning: Undefined variable $now in /in/pkDRc on line 28 foobar</h1> </body> </html>
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0, 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
<!DOCTYPE html> <html> <head> </head> <body> <p id="test"> Current Time: July 28<sup>th</sup> at 8:16 PM 1469729790</br> First Tuesday: July 2<sup>nd</sup> at 4:00 PM 1467468000</br> Second Tuesday: July 9<sup>th</sup> at 5:00 PM 1468076400</br> Fourth Tuesday: July 23<sup>rd</sup> at 5:00 PM 1469286000</br> Next Month First Tuesday: August 2<sup>nd</sup> at 4:00 PM 1470146400</p> <h2>Next Council Meeting:</h2> <h1> Notice: Undefined variable: now in /in/pkDRc on line 13 Notice: Undefined variable: firstTues in /in/pkDRc on line 13 Notice: Undefined variable: firstTues in /in/pkDRc on line 18 Notice: Undefined variable: now in /in/pkDRc on line 18 Notice: Undefined variable: secondTues in /in/pkDRc on line 23 Notice: Undefined variable: now in /in/pkDRc on line 23 Notice: Undefined variable: fourthTues in /in/pkDRc on line 28 Notice: Undefined variable: now in /in/pkDRc on line 28 foobar</h1> </body> </html>
Output for 7.3.32 - 7.3.33
<!DOCTYPE html> <html> <head> </head> <body> <p id="test"> Current Time: July 28<sup>th</sup> at 6:16 PM 1469729790</br> First Tuesday: July 2<sup>nd</sup> at 4:00 PM 1467475200</br> Second Tuesday: July 9<sup>th</sup> at 5:00 PM 1468083600</br> Fourth Tuesday: July 23<sup>rd</sup> at 5:00 PM 1469293200</br> Next Month First Tuesday: August 2<sup>nd</sup> at 4:00 PM 1470153600</p> <h2>Next Council Meeting:</h2> <h1>foobar</h1> </body> </html>
Output for 7.2.6
<!DOCTYPE html> <html> <head> </head> <body> <p id="test"> Current Time: July 28<sup>th</sup> at 8:16 PM 1469729791</br> First Tuesday: July 2<sup>nd</sup> at 4:00 PM 1467468000</br> Second Tuesday: July 9<sup>th</sup> at 5:00 PM 1468076400</br> Fourth Tuesday: July 23<sup>rd</sup> at 5:00 PM 1469286000</br> Next Month First Tuesday: August 2<sup>nd</sup> at 4:00 PM 1470146400</p> <h2>Next Council Meeting:</h2> <h1> Notice: Undefined variable: now in /in/pkDRc on line 13 Notice: Undefined variable: firstTues in /in/pkDRc on line 13 Notice: Undefined variable: firstTues in /in/pkDRc on line 18 Notice: Undefined variable: now in /in/pkDRc on line 18 Notice: Undefined variable: secondTues in /in/pkDRc on line 23 Notice: Undefined variable: now in /in/pkDRc on line 23 Notice: Undefined variable: fourthTues in /in/pkDRc on line 28 Notice: Undefined variable: now in /in/pkDRc on line 28 foobar</h1> </body> </html>
Output for 5.6.0 - 5.6.24
<!DOCTYPE html> <html> <head> </head> <body> <p id="test"> Current Time: July 28<sup>th</sup> at 8:16 PM 1469729790</br> First Tuesday: July 2<sup>nd</sup> at 4:00 PM 1467468000</br> Second Tuesday: July 9<sup>th</sup> at 5:00 PM 1468076400</br> Fourth Tuesday: July 23<sup>rd</sup> at 5:00 PM 1469286000</br> Next Month First Tuesday: August 2<sup>nd</sup> at 4:00 PM 1470146400</p> <h2>Next Council Meeting:</h2> <h1> Notice: Undefined variable: firstTues in /in/pkDRc on line 13 Notice: Undefined variable: now in /in/pkDRc on line 13 Notice: Undefined variable: now in /in/pkDRc on line 18 Notice: Undefined variable: firstTues in /in/pkDRc on line 18 Notice: Undefined variable: now in /in/pkDRc on line 23 Notice: Undefined variable: secondTues in /in/pkDRc on line 23 Notice: Undefined variable: now in /in/pkDRc on line 28 Notice: Undefined variable: fourthTues in /in/pkDRc on line 28 foobar</h1> </body> </html>

preferences:
164.3 ms | 403 KiB | 185 Q