3v4l.org

run code in 300+ PHP versions simultaneously
<?php function daysBetweenDates($startDate, $endDate) { list($year1, $month1, $day1) = explode('-', $startDate); list($year2, $month2, $day2) = explode('-', $endDate); $f = mktime(0, 0, 0, $month2, $day2, $year2); $i = mktime(0, 0, 0, $month1, $day1, $year1); $difference = $f - $i; $days = floor($difference/86400); return $days; } $startDate = '2014-10-14'; $endDate = '2014-10-28'; print_r(daysBetweenDates($startDate, $endDate));
Output for git.master, git.master_jit, rfc.property-hooks
14

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