3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date1 = new DateTime('2015-01-01'); $date2 = new DateTime('2015-12-29'); $interval = $date2->diff($date1); $months = ($interval->y * 12) + $interval->m; $months += number_format($interval->d / 30, 2); echo $months; echo float(3.5793);
based on rOI4c