3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $startdate_2015 = strtotime(date('2015-03-25')); $enddate_2015 = strtotime(date("2015-03-28")); $nights_2015 = floor($enddate_2015 - $startdate_2015); echo 'nights in 2015: '.$nights_2015 = floor($nights_2015/(60*60*24)); echo PHP_EOL; $startdate_2016 = strtotime(date('2016-03-25')); $enddate_2016 = strtotime(date("2016-03-28")); $nights_2016 = floor($enddate_2016 - $startdate_2016); echo 'nights in 2016: '.$nights_2016 = floor($nights_2016/(60*60*24)); echo PHP_EOL; $startdate_2017 = strtotime(date('2017-03-25')); $enddate_2017 = strtotime(date("2017-03-28")); $nights_2017 = floor($enddate_2017 - $startdate_2017); echo 'nights in 2017: '.$nights_2017 = floor($nights_2017/(60*60*24)); echo PHP_EOL; $startdate_2018 = strtotime(date('2018-03-25')); $enddate_2018 = strtotime(date("2018-03-28")); $nights_2018 = floor($enddate_2018 - $startdate_2018); echo 'nights in 2018: '.$nights_2018 = floor($nights_2018/(60*60*24)); echo PHP_EOL; $startdate_2019 = strtotime(date('2019-03-25')); $enddate_2019 = strtotime(date("2019-03-28")); $nights_2019 = floor($enddate_2019 - $startdate_2019); echo 'nights in 2019: '.$nights_2019 = floor($nights_2019/(60*60*24)); echo PHP_EOL;
based on Y43L4
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.3.0beta1
nights in 2015: 3 nights in 2016: 2 nights in 2017: 2 nights in 2018: 2 nights in 2019: 3