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 git.master, git.master_jit, rfc.property-hooks
<!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>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
32.66 ms | 403 KiB | 8 Q