3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo "Now: ", $now = strtotime("now"), "\n"; echo "Then: ", $then = strtotime("now -20 years"), "\n"; echo $now2 = strtotime("now +1 year"), "\n"; echo $then2 = strtotime("now -19 years"), "\n"; echo "Dif 1: ", ($now-$then) / 60 / 60, " hours\n"; echo "Dif 2: ", $dif2 = ($now2-$then2) / 60 / 60, " hours\n"; echo "Simple: ", $simple = 20*365*24, " hours\n"; echo "Dif to simple ", $dif2 - $simple, "hours\n";
based on 5gXB8
Output for 5.6.28, 7.0.20 - 7.1.5, 7.1.7 - 7.2.0
Now: 1453302423 Then: 822150423 1484924823 853772823 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 7.1.6
Now: 1453302424 Then: 822150424 1484924824 853772824 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 7.0.6
Now: 1463832324 Then: 832680324 1495368324 864216324 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 7.0.5
Now: 1459670380 Then: 828518380 1491206380 860054380 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 7.0.4
Now: 1457644063 Then: 826492063 1489180063 858028063 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 7.0.3
Now: 1458340972 Then: 827188972 1489876972 858724972 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 7.0.2
Now: 1458708620 Then: 827556620 1490244620 859092620 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 7.0.1
Now: 1458805935 Then: 827653935 1490341935 859189935 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 7.0.0
Now: 1459068309 Then: 827919909 1490604309 859455909 Dif 1: 175319 hours Dif 2: 175319 hours Simple: 175200 hours Dif to simple 119hours
Output for 5.6.21
Now: 1462200878 Then: 831048878 1493736878 862584878 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.6.20
Now: 1460271729 Then: 829119729 1491807729 860655729 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.6.19
Now: 1457414262 Then: 826262262 1488950262 857798262 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.6.18
Now: 1458051421 Then: 826899421 1489587421 858435421 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.6.17
Now: 1458438555 Then: 827286555 1489974555 858822555 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.6.16
Now: 1459157695 Then: 828009295 1490693695 859545295 Dif 1: 175319 hours Dif 2: 175319 hours Simple: 175200 hours Dif to simple 119hours
Output for 5.6.15
Now: 1459247087 Then: 828098687 1490783087 859634687 Dif 1: 175319 hours Dif 2: 175319 hours Simple: 175200 hours Dif to simple 119hours
Output for 5.6.14
Now: 1460650040 Then: 829498040 1492186040 861034040 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.6.13
Now: 1460738789 Then: 829586789 1492274789 861122789 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.6.12
Now: 1461136624 Then: 829984624 1492672624 861520624 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.6.11
Now: 1461505374 Then: 830353374 1493041374 861889374 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.6.10
Now: 1461599313 Then: 830447313 1493135313 861983313 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.6.9
Now: 1461791814 Then: 830639814 1493327814 862175814 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.6.8
Now: 1461994955 Then: 830842955 1493530955 862378955 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.5.35
Now: 1463965229 Then: 832813229 1495501229 864349229 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.5.34
Now: 1460366219 Then: 829214219 1491902219 860750219 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.5.33
Now: 1457511777 Then: 826359777 1489047777 857895777 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.5.32
Now: 1458238577 Then: 827086577 1489774577 858622577 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.5.31
Now: 1458536601 Then: 827384601 1490072601 858920601 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.5.30
Now: 1459512952 Then: 828360952 1491048952 859896952 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.5.29
Now: 1460876640 Then: 829724640 1492412640 861260640 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.5.28
Now: 1461234989 Then: 830082989 1492770989 861618989 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.5.27
Now: 1461327221 Then: 830175221 1492863221 861711221 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.5.26
Now: 1461695407 Then: 830543407 1493231407 862079407 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.5.25
Now: 1461895024 Then: 830743024 1493431024 862279024 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.5.24
Now: 1464078522 Then: 832926522 1495614522 864462522 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.4.44 - 5.4.45
Now: 1453302427 Then: 822150427 1484924827 853772827 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.4.42 - 5.4.43
Now: 1453302428 Then: 822150428 1484924828 853772828 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.4.41
Now: 1453302429 Then: 822150429 1484924829 853772829 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.4.39 - 5.4.40
Now: 1453302430 Then: 822150430 1484924830 853772830 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.4.37 - 5.4.38
Now: 1453302431 Then: 822150431 1484924831 853772831 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.4.34 - 5.4.36
Now: 1453302432 Then: 822150432 1484924832 853772832 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.3.29, 5.4.31 - 5.4.32
Now: 1453302433 Then: 822150433 1484924833 853772833 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.4.28 - 5.4.30
Now: 1453302434 Then: 822150434 1484924834 853772834 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.4.24 - 5.4.27
Now: 1453302435 Then: 822150435 1484924835 853772835 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.3.28, 5.4.21 - 5.4.23
Now: 1453302436 Then: 822150436 1484924836 853772836 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.4.18 - 5.4.20
Now: 1453302437 Then: 822150437 1484924837 853772837 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.3.26 - 5.3.27, 5.4.16 - 5.4.17
Now: 1453302438 Then: 822150438 1484924838 853772838 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours
Output for 5.3.22 - 5.3.25, 5.4.12 - 5.4.15
Now: 1453302439 Then: 822150439 1484924839 853772839 Dif 1: 175320 hours Dif 2: 175320 hours Simple: 175200 hours Dif to simple 120hours