3v4l.org

run code in 300+ PHP versions simultaneously
<?php $nonNewDay = array( array( '2:00 am', '11:00 am' ), array( '2:00 am', '11:00 am' ), array( '2:00 am', '11:00 am' ), array( '2:00 am', '11:00 am' ), array( '2:00 am', '11:00 am' ), // Weekends array( '2:00 am', '4:00 pm' ), array( '2:00 am', '1:00 pm' ), ); $current_date = strtotime(date("g:00 a")); $value = $nonNewDay[date('N')-1]; // for php < 5.1, I think this one will do the work: // $value = $nonNewDay[(date('w') == 0 ? 6 : date('N')-1)]; if ((strtotime($value[0]) <= $current_date) && ($current_date < strtotime($value[1]))) { echo 'Blocked'; } ?>
Output for git.master, git.master_jit, rfc.property-hooks

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:
38.99 ms | 401 KiB | 8 Q