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 $now-$then, "\n"; echo $now2-$then2, "\n";
based on YptMN
Output for 5.6.28, 7.0.20 - 7.2.0
Now: 1453300419 Then: 822148419 1484922819 853770819 631152000 631152000
Output for 7.0.6
Now: 1463832314 Then: 832680314 1495368314 864216314 631152000 631152000
Output for 7.0.5
Now: 1459670372 Then: 828518372 1491206372 860054372 631152000 631152000
Output for 7.0.4
Now: 1457644055 Then: 826492055 1489180055 858028055 631152000 631152000
Output for 7.0.3
Now: 1458340963 Then: 827188963 1489876963 858724963 631152000 631152000
Output for 7.0.2
Now: 1458708611 Then: 827556611 1490244611 859092611 631152000 631152000
Output for 7.0.1
Now: 1458805927 Then: 827653927 1490341927 859189927 631152000 631152000
Output for 7.0.0
Now: 1459068302 Then: 827919902 1490604302 859455902 631148400 631148400
Output for 5.6.21
Now: 1462200870 Then: 831048870 1493736870 862584870 631152000 631152000
Output for 5.6.20
Now: 1460271720 Then: 829119720 1491807720 860655720 631152000 631152000
Output for 5.6.19
Now: 1457414254 Then: 826262254 1488950254 857798254 631152000 631152000
Output for 5.6.18
Now: 1458051412 Then: 826899412 1489587412 858435412 631152000 631152000
Output for 5.6.17
Now: 1458438544 Then: 827286544 1489974544 858822544 631152000 631152000
Output for 5.6.16
Now: 1459157686 Then: 828009286 1490693686 859545286 631148400 631148400
Output for 5.6.15
Now: 1459247078 Then: 828098678 1490783078 859634678 631148400 631148400
Output for 5.6.14
Now: 1460650032 Then: 829498032 1492186032 861034032 631152000 631152000
Output for 5.6.13
Now: 1460738781 Then: 829586781 1492274781 861122781 631152000 631152000
Output for 5.6.12
Now: 1461136616 Then: 829984616 1492672616 861520616 631152000 631152000
Output for 5.6.11
Now: 1461505356 Then: 830353356 1493041356 861889356 631152000 631152000
Output for 5.6.10
Now: 1461599305 Then: 830447305 1493135305 861983305 631152000 631152000
Output for 5.6.9
Now: 1461791794 Then: 830639794 1493327794 862175794 631152000 631152000
Output for 5.6.8
Now: 1461994947 Then: 830842947 1493530947 862378947 631152000 631152000
Output for 5.5.35
Now: 1463965217 Then: 832813217 1495501217 864349217 631152000 631152000
Output for 5.5.34
Now: 1460366210 Then: 829214210 1491902210 860750210 631152000 631152000
Output for 5.5.33
Now: 1457511769 Then: 826359769 1489047769 857895769 631152000 631152000
Output for 5.5.32
Now: 1458238567 Then: 827086567 1489774567 858622567 631152000 631152000
Output for 5.5.31
Now: 1458536588 Then: 827384588 1490072588 858920588 631152000 631152000
Output for 5.5.30
Now: 1459512944 Then: 828360944 1491048944 859896944 631152000 631152000
Output for 5.5.29
Now: 1460876631 Then: 829724631 1492412631 861260631 631152000 631152000
Output for 5.5.28
Now: 1461234980 Then: 830082980 1492770980 861618980 631152000 631152000
Output for 5.5.27
Now: 1461327203 Then: 830175203 1492863203 861711203 631152000 631152000
Output for 5.5.26
Now: 1461695400 Then: 830543400 1493231400 862079400 631152000 631152000
Output for 5.5.25
Now: 1461895016 Then: 830743016 1493431016 862279016 631152000 631152000
Output for 5.5.24
Now: 1464078513 Then: 832926513 1495614513 864462513 631152000 631152000
Output for 5.4.44 - 5.4.45
Now: 1453300421 Then: 822148421 1484922821 853770821 631152000 631152000
Output for 5.4.41 - 5.4.43
Now: 1453300422 Then: 822148422 1484922822 853770822 631152000 631152000
Output for 5.4.39 - 5.4.40
Now: 1453300423 Then: 822148423 1484922823 853770823 631152000 631152000
Output for 5.4.36 - 5.4.38
Now: 1453300424 Then: 822148424 1484922824 853770824 631152000 631152000
Output for 5.4.34 - 5.4.35
Now: 1453300425 Then: 822148425 1484922825 853770825 631152000 631152000
Output for 5.3.29, 5.4.31 - 5.4.32
Now: 1453300426 Then: 822148426 1484922826 853770826 631152000 631152000
Output for 5.4.26 - 5.4.30
Now: 1453300427 Then: 822148427 1484922827 853770827 631152000 631152000
Output for 5.4.23 - 5.4.25
Now: 1453300428 Then: 822148428 1484922828 853770828 631152000 631152000
Output for 5.3.28, 5.4.20 - 5.4.22
Now: 1453300429 Then: 822148429 1484922829 853770829 631152000 631152000
Output for 5.3.27, 5.4.17 - 5.4.19
Now: 1453300430 Then: 822148430 1484922830 853770830 631152000 631152000
Output for 5.3.24 - 5.3.26, 5.4.13 - 5.4.16
Now: 1453300431 Then: 822148431 1484922831 853770831 631152000 631152000
Output for 5.3.22 - 5.3.23, 5.4.12
Now: 1453300432 Then: 822148432 1484922832 853770832 631152000 631152000