3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $d = 12; if(!isset($d) || $d<=0){ echo $d; } $dt = new DateTime(); $dt = $dt->modify('-' . $d . 'days'); echo $dt->getTimeStamp();
based on 6uWqU
Output for 5.6.28, 7.0.14 - 7.1.0
1407669600
Output for 7.0.6
1461225947
Output for 7.0.5
1458597239
Output for 7.0.4
1456561720
Output for 7.0.3
1457255239
Output for 7.0.2
1457622027
Output for 7.0.1
1457725409
Output for 7.0.0
1457990160
Output for hhvm-3.12.0
1456745106
Output for hhvm-3.10.0
1458297830
Output for 5.6.21
1461122737
Output for 5.6.20
1459194692
Output for 5.6.19
1456331789
Output for 5.6.18
1456965609
Output for 5.6.17
1457356901
Output for 5.6.16
1458082960
Output for 5.6.15
1458173274
Output for 5.6.14
1458527258
Output for 5.6.13
1459660900
Output for 5.6.12
1460056112
Output for 5.6.11
1460340680
Output for 5.6.10
1460519714
Output for 5.6.9
1460710378
Output for 5.6.8
1460912428
Output for 5.5.35
1462864386
Output for 5.5.34
1459289552
Output for 5.5.33
1456428802
Output for 5.5.32
1457144118
Output for 5.5.31
1457453243
Output for 5.5.30
1458439472
Output for 5.5.29
1459798086
Output for 5.5.28
1460153697
Output for 5.5.27
1460248940
Output for 5.5.26
1460614911
Output for 5.5.25
1460810416
Output for 5.5.24
1463060656
Output for 5.4.45
1441795439
Output for 5.4.44
1441795433
Output for 5.4.43
1441795427
Output for 5.4.42
1441795424
Output for 5.4.41
1441795421
Output for 5.4.40
1441795418
Output for 5.4.39
1441795416
Output for 5.4.38
1425312908
Output for 5.4.36 - 5.4.37
1425312900
Output for 5.4.34 - 5.4.35
1425312899
Output for 5.4.32
1408182782
Output for 5.4.16 - 5.4.31
1407669605
Output for 5.3.23 - 5.3.28, 5.4.0 - 5.4.15
1407669606
Output for 5.3.29
1408182781
Output for 5.3.1 - 5.3.22
1407669607
Output for 5.3.0
1407669608
Output for 5.2.0 - 5.2.17
Fatal error: Call to a member function getTimeStamp() on a non-object in /in/dUfZC on line 8
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/dUfZC on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/dUfZC on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/dUfZC on line 6