3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $days = 500; $years_remaining = intval($days / 365); //divide by 365 and throw away the remainder $days_remaining = $days % 365; echo $years_remaining . " years and " . $days_remaining . " days";
based on UQedE
Output for 4.3.0 - 5.6.25, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
1 years and 135 days