3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "Now: ", $now = strtotime("now"), "\n"; echo "2 years ago: ", $then = strtotime("now -2 years"), "\n"; echo "6 years ago: ", $now2 = strtotime("now -6 years"), "\n"; echo "8 years ago: ", $then2 = strtotime("now -8 years"), "\n"; echo "Dif 1: ", $dif1 = ($now-$then) / 60 / 60, " hours\n"; echo "Dif 2: ", $dif2 = ($now2-$then2) / 60 / 60, " hours\n"; echo "Two years simple: ", $simple = 2*365*24, " hours\n"; echo "Dif1 to dif2 ", $dif2 - $dif1, " hours\n"; echo "Dif1 to simple ", $dif1 - $simple, " hours\n";
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.32, 7.1.0 - 7.1.24, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Now: 1453305256 2 years ago: 1390233256 6 years ago: 1264002856 8 years ago: 1200844456 Dif 1: 17520 hours Dif 2: 17544 hours Two years simple: 17520 hours Dif1 to dif2 24 hours Dif1 to simple 0 hours
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 Now: 1453305256 2 years ago: 1390233256 6 years ago: 1264002856 8 years ago: 1200844456 Dif 1: 17520 hours Dif 2: 17544 hours Two years simple: 17520 hours Dif1 to dif2 24 hours Dif1 to simple 0 hours

preferences:
215.92 ms | 402 KiB | 289 Q