3v4l.org

run code in 300+ PHP versions simultaneously
<?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 '<p>'; $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 '<p>'; $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 '<p>'; $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 '<p>'; $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 '<p>';
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
nights in 2015: 3<p>nights in 2016: 2<p>nights in 2017: 2<p>nights in 2018: 2<p>nights in 2019: 3<p>
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 nights in 2015: 3<p>nights in 2016: 2<p>nights in 2017: 2<p>nights in 2018: 2<p>nights in 2019: 3<p>
Output for 7.3.32 - 7.3.33, 8.0.13
nights in 2015: 3<p>nights in 2016: 3<p>nights in 2017: 3<p>nights in 2018: 3<p>nights in 2019: 3<p>

preferences:
151.36 ms | 402 KiB | 170 Q