3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function get_weekday($date) { $week_day = date('w',$date); if ($week_day == 0) return strtotime("+1 day",$date); elseif ($week_day == 6) return strtotime("+2 day", $date); return time($date); } for($i = 1; $i < 10; $i++) { $today = strtotime("+$i days"); $quote_for = get_weekday($today); $diff = ceil(($quote_for - $today)/86400); // difference in days echo "On " . date('l \t\h\e jS',$today) . " the shipping quote will be for " . date('l \t\h\e jS', $quote_for) . " which is " . abs($diff) . " days " . ($diff <0?"before":"after") . " today. " . date('Y-m-d',$today) . " - " . date('Y-m-d',$quote_for) . "\n"; }
Output for 4.3.0 - 4.4.9, 5.0.3 - 5.6.28, 7.0.0 - 7.1.0
On Wednesday the 30th the shipping quote will be for Tuesday the 29th which is 1 days before today. 2013-01-30 - 2013-01-29 On Thursday the 31st the shipping quote will be for Tuesday the 29th which is 2 days before today. 2013-01-31 - 2013-01-29 On Friday the 1st the shipping quote will be for Tuesday the 29th which is 3 days before today. 2013-02-01 - 2013-01-29 On Saturday the 2nd the shipping quote will be for Monday the 4th which is 2 days after today. 2013-02-02 - 2013-02-04 On Sunday the 3rd the shipping quote will be for Monday the 4th which is 1 days after today. 2013-02-03 - 2013-02-04 On Monday the 4th the shipping quote will be for Tuesday the 29th which is 6 days before today. 2013-02-04 - 2013-01-29 On Tuesday the 5th the shipping quote will be for Tuesday the 29th which is 7 days before today. 2013-02-05 - 2013-01-29 On Wednesday the 6th the shipping quote will be for Tuesday the 29th which is 8 days before today. 2013-02-06 - 2013-01-29 On Thursday the 7th the shipping quote will be for Tuesday the 29th which is 9 days before today. 2013-02-07 - 2013-01-29
Output for hhvm-3.12.0
Warning: time() expects exactly 0 parameters, 1 given in /in/G0hoD on line 11 Warning: date() expects parameter 2 to be integer, null given in /in/G0hoD on line 24 Warning: date() expects parameter 2 to be integer, null given in /in/G0hoD on line 26 On Wednesday the 30th the shipping quote will be for which is 15735 days before today. 2013-01-30 - Warning: time() expects exactly 0 parameters, 1 given in /in/G0hoD on line 11 Warning: date() expects parameter 2 to be integer, null given in /in/G0hoD on line 24 Warning: date() expects parameter 2 to be integer, null given in /in/G0hoD on line 26 On Thursday the 31st the shipping quote will be for which is 15736 days before today. 2013-01-31 - Warning: time() expects exactly 0 parameters, 1 given in /in/G0hoD on line 11 Warning: date() expects parameter 2 to be integer, null given in /in/G0hoD on line 24 Warning: date() expects parameter 2 to be integer, null given in /in/G0hoD on line 26 On Friday the 1st the shipping quote will be for which is 15737 days before today. 2013-02-01 - On Saturday the 2nd the shipping quote will be for Monday the 4th which is 2 days after today. 2013-02-02 - 2013-02-04 On Sunday the 3rd the shipping quote will be for Monday the 4th which is 1 days after today. 2013-02-03 - 2013-02-04 Warning: time() expects exactly 0 parameters, 1 given in /in/G0hoD on line 11 Warning: date() expects parameter 2 to be integer, null given in /in/G0hoD on line 24 Warning: date() expects parameter 2 to be integer, null given in /in/G0hoD on line 26 On Monday the 4th the shipping quote will be for which is 15740 days before today. 2013-02-04 - Warning: time() expects exactly 0 parameters, 1 given in /in/G0hoD on line 11 Warning: date() expects parameter 2 to be integer, null given in /in/G0hoD on line 24 Warning: date() expects parameter 2 to be integer, null given in /in/G0hoD on line 26 On Tuesday the 5th the shipping quote will be for which is 15741 days before today. 2013-02-05 - Warning: time() expects exactly 0 parameters, 1 given in /in/G0hoD on line 11 On Wednesday the 6th the shipping quote will be for which is 15742 days before today. 2013-02-06 - On Thursday the 7th the shipping quote will be for which is 15743 days before today. 2013-02-07 -
Output for hhvm-3.10.0
Warning: time() expects exactly 0 parameters, 1 given in /in/G0hoD on line 11 On Wednesday the 30th the shipping quote will be for Thursday the 1st which is 15735 days before today. 2013-01-30 - 1970-01-01 Warning: time() expects exactly 0 parameters, 1 given in /in/G0hoD on line 11 On Thursday the 31st the shipping quote will be for Thursday the 1st which is 15736 days before today. 2013-01-31 - 1970-01-01 Warning: time() expects exactly 0 parameters, 1 given in /in/G0hoD on line 11 On Friday the 1st the shipping quote will be for Thursday the 1st which is 15737 days before today. 2013-02-01 - 1970-01-01 On Saturday the 2nd the shipping quote will be for Monday the 4th which is 2 days after today. 2013-02-02 - 2013-02-04 On Sunday the 3rd the shipping quote will be for Monday the 4th which is 1 days after today. 2013-02-03 - 2013-02-04 Warning: time() expects exactly 0 parameters, 1 given in /in/G0hoD on line 11 On Monday the 4th the shipping quote will be for Thursday the 1st which is 15740 days before today. 2013-02-04 - 1970-01-01 Warning: time() expects exactly 0 parameters, 1 given in /in/G0hoD on line 11 On Tuesday the 5th the shipping quote will be for Thursday the 1st which is 15741 days before today. 2013-02-05 - 1970-01-01 Warning: time() expects exactly 0 parameters, 1 given in /in/G0hoD on line 11 On Wednesday the 6th the shipping quote will be for Thursday the 1st which is 15742 days before today. 2013-02-06 - 1970-01-01 Warning: time() expects exactly 0 parameters, 1 given in /in/G0hoD on line 11 On Thursday the 7th the shipping quote will be for Thursday the 1st which is 15743 days before today. 2013-02-07 - 1970-01-01
Output for 5.0.0 - 5.0.2
On Wednesday the 30th the shipping quote will be for Tuesday the 29th which is 0 days after today. 2013-01-30 - 2013-01-29 On Thursday the 31st the shipping quote will be for Tuesday the 29th which is 1 days before today. 2013-01-31 - 2013-01-29 On Friday the 1st the shipping quote will be for Tuesday the 29th which is 2 days before today. 2013-02-01 - 2013-01-29 On Saturday the 2nd the shipping quote will be for Monday the 4th which is 2 days after today. 2013-02-02 - 2013-02-04 On Sunday the 3rd the shipping quote will be for Monday the 4th which is 1 days after today. 2013-02-03 - 2013-02-04 On Monday the 4th the shipping quote will be for Tuesday the 29th which is 5 days before today. 2013-02-04 - 2013-01-29 On Tuesday the 5th the shipping quote will be for Tuesday the 29th which is 6 days before today. 2013-02-05 - 2013-01-29 On Wednesday the 6th the shipping quote will be for Tuesday the 29th which is 7 days before today. 2013-02-06 - 2013-01-29 On Thursday the 7th the shipping quote will be for Tuesday the 29th which is 8 days before today. 2013-02-07 - 2013-01-29