3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date1 = new DateTime(); $date2 = new DateTime('2 hours ago'); $date3 = new DateTime('2 days ago'); $limit = 2 * 60 * 60; $diff = $date1->diff($date2); $diff2 = $date1->diff($date3); var_dump($date1->getTimestamp());
based on KPJkV
Output for 5.6.28, 7.0.20 - 7.2.0
int(1451288588)
Output for 7.0.6
int(1463828760)
Output for 7.0.5
int(1459667402)
Output for 7.0.4
int(1457640957)
Output for 7.0.3
int(1458337074)
Output for 7.0.2
int(1458705081)
Output for 7.0.1
int(1458802808)
Output for 7.0.0
int(1459065214)
Output for 5.6.21
int(1462197740)
Output for 5.6.20
int(1460268712)
Output for 5.6.19
int(1457411007)
Output for 5.6.18
int(1458047948)
Output for 5.6.17
int(1458435089)
Output for 5.6.16
int(1459154585)
Output for 5.6.15
int(1459243926)
Output for 5.6.14
int(1460646865)
Output for 5.6.13
int(1460735604)
Output for 5.6.12
int(1461133340)
Output for 5.6.11
int(1461502085)
Output for 5.6.10
int(1461596015)
Output for 5.6.9
int(1461787854)
Output for 5.6.8
int(1461991845)
Output for 5.5.35
int(1463960268)
Output for 5.5.34
int(1460363121)
Output for 5.5.33
int(1457508148)
Output for 5.5.32
int(1458234904)
Output for 5.5.31
int(1458532793)
Output for 5.5.30
int(1459509868)
Output for 5.5.29
int(1460873474)
Output for 5.5.28
int(1461231626)
Output for 5.5.27
int(1461323993)
Output for 5.5.26
int(1461692066)
Output for 5.5.25
int(1461891504)
Output for 5.5.24
int(1464074626)
Output for 5.4.45
int(1451288590)
Output for 5.4.44
int(1451288591)
Output for 5.4.41 - 5.4.43
int(1451288592)
Output for 5.4.38 - 5.4.40
int(1451288593)
Output for 5.4.34 - 5.4.37
int(1451288594)
Output for 5.3.29, 5.4.29 - 5.4.32
int(1451288595)
Output for 5.4.23 - 5.4.28
int(1451288596)
Output for 5.3.28, 5.4.18 - 5.4.22
int(1451288597)
Output for 5.3.23 - 5.3.27, 5.4.12 - 5.4.17
int(1451288598)
Output for 5.3.21 - 5.3.22, 5.4.11
int(1451288599)