3v4l.org

run code in 300+ PHP versions simultaneously
<?php function add_deadline($givenDate, $hours){ $range = (ceil($hours/7)*120); $cnt=1; $goodhours = array(); foreach(range(1,$range) as $num): $datetime = date("Y-m-d H:i:s", strtotime('+'.$num.' hour',strtotime($givenDate))); $time = date("Hi", strtotime('+'.$num.' hour',strtotime($givenDate))); $day = date("D", strtotime('+'.$num.' hour', strtotime($givenDate))); if($day != 'Sat' && $day != 'Sun' && $time >= 830 && $time <= 1730): $goodhours[$cnt] = $datetime; if($cnt >= $hours && array_key_exists($hours,$goodhours)): return $goodhours[$hours]; break; endif; $cnt++; endif; endforeach; } //Pass in date and the hours to add on $future = add_deadline('2014-06-27 08:30:00', '65'); echo $future;
Output for git.master, git.master_jit, rfc.property-hooks
2014-07-07 13:30:00

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