3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getNextBinDay() { // First Wednesday bin day of year //$date = strtotime('2020-01-15 00:00:00'); // Current day (numeric) $day = intval( date('N') ); // Get next Wednesday from today $offset = ($day >= 3) ? 10 - $day : 3 - $day; $nextTimestamp = strtotime( '+' . $offset . ' days' ); $dateText = date( 'l jS F', $nextTimestamp ); // Difference in weeks between dates (86400 * 7) //$diff = ceil( ( $nextTimestamp - $date ) / 604800 ); $firstDate = DateTime::createFromFormat( 'Y-m-d H:i:s', '2020-01-15 02:00:00' ); $secondDate = DateTime::createFromFormat( 'Y-m-d H:i:s', date('Y-m-d 02:00:00', $nextTimestamp) ); $diff = $firstDate->diff($secondDate)->days; $bin = ( $diff % 2 === 0 ) ? 'Blue and Brown' : 'Green'; return 'The next bin day in Chorley woooo is ' . $bin . ' bins on ' . $dateText; } var_dump(getNextBinDay());
Output for git.master_jit, git.master, rfc.property-hooks
string(80) "The next bin day in Chorley woooo is Blue and Brown bins on Wednesday 7th August"

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:
79.62 ms | 405 KiB | 5 Q