3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $d = 12.34; if(!isset($d) || $d<=0){ echo $d; } $dt = new DateTime(); $dt = $dt->modify('-' . $d . 'days'); echo $dt->getTimeStamp();
based on JnGPp
Output for 5.6.28, 7.0.14 - 7.1.0
1411643987
Output for 7.0.6
1465199125
Output for 7.0.5
1462567026
Output for 7.0.4
1460531389
Output for 7.0.3
1461224824
Output for 7.0.2
1461591650
Output for 7.0.1
1461695151
Output for 7.0.0
1461959907
Output for hhvm-3.12.0
1460664865
Output for hhvm-3.10.0
1462267001
Output for 5.6.21
1465096007
Output for 5.6.20
1463168035
Output for 5.6.19
1460301466
Output for 5.6.18
1460934732
Output for 5.6.17
1461326547
Output for 5.6.16
1462052628
Output for 5.6.15
1462142937
Output for 5.6.14
1462496990
Output for 5.6.13
1463634263
Output for 5.6.12
1464029327
Output for 5.6.11
1464313969
Output for 5.6.10
1464492991
Output for 5.6.9
1464683671
Output for 5.6.8
1464885557
Output for 5.5.35
1466837390
Output for 5.5.34
1463262850
Output for 5.5.33
1460398487
Output for 5.5.32
1461113707
Output for 5.5.31
1461422897
Output for 5.5.30
1462409080
Output for 5.5.29
1463771377
Output for 5.5.28
1464126831
Output for 5.5.27
1464222218
Output for 5.5.26
1464588210
Output for 5.5.25
1464783678
Output for 5.5.24
1466970163
Output for 5.4.45
1445773437
Output for 5.4.44
1445773432
Output for 5.4.43
1445773426
Output for 5.4.42
1445773424
Output for 5.4.41
1445773421
Output for 5.4.40
1445773418
Output for 5.4.39
1445773416
Output for 5.4.38
1429179603
Output for 5.4.36 - 5.4.37
1429179594
Output for 5.4.34 - 5.4.35
1429179593
Output for 5.4.32
1412157159
Output for 5.4.24 - 5.4.31
1411643991
Output for 5.4.1 - 5.4.23
1411643992
Output for 5.3.9 - 5.3.28, 5.4.0
1411643993
Output for 5.3.29
1412157158
Output for 5.3.0 - 5.3.8
1411643994
Output for 5.2.0 - 5.2.17
Fatal error: Call to a member function getTimeStamp() on a non-object in /in/6uWqU on line 8
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/6uWqU 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/6uWqU 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/6uWqU on line 6