3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dt = new DateTime('2000-01-01 13:12:12.129817'); echo $dt->getTimestamp() * 1000; echo "\n"; $date = new DateTime(); echo $date->getTimestamp() * 1000;
Output for 5.6.28, 7.0.14 - 7.1.0
946728732000 1394508434000
Output for 7.0.6
946728732000 1462234352000
Output for 7.0.5
946728732000 1459603665000
Output for 7.0.4
946728732000 1457567763000
Output for 7.0.3
946728732000 1458259698000
Output for 7.0.2
946728732000 1458557003000
Output for 7.0.1
946728732000 1458730507000
Output for 7.0.0
946728732000 1458998787000
Output for hhvm-3.12.0
946728732000 1457670577000
Output for hhvm-3.10.0
946728732000 1459272155000
Output for 5.6.21
946728732000 1462130093000
Output for 5.6.20
946728732000 1460191353000
Output for 5.6.19
946728732000 1457302283000
Output for 5.6.18
946728732000 1457949109000
Output for 5.6.17
946728732000 1458362234000
Output for 5.6.16
946728732000 1459087890000
Output for 5.6.15
946728732000 1459177505000
Output for 5.6.14
946728732000 1459532616000
Output for 5.6.13
946728732000 1460669492000
Output for 5.6.12
946728732000 1461062388000
Output for 5.6.11
946728732000 1461347763000
Output for 5.6.10
946728732000 1461526555000
Output for 5.6.9
946728732000 1461717903000
Output for 5.6.8
946728732000 1461918015000
Output for 5.6.7
946728732000 1464116455000
Output for 5.5.35
946728732000 1463870112000
Output for 5.5.34
946728732000 1460299093000
Output for 5.5.33
946728732000 1457434211000
Output for 5.5.32
946728732000 1458145851000
Output for 5.5.31
946728732000 1458459013000
Output for 5.5.30
946728732000 1459443993000
Output for 5.5.29
946728732000 1460806694000
Output for 5.5.28
946728732000 1461160450000
Output for 5.5.27
946728732000 1461256059000
Output for 5.5.26
946728732000 1461621195000
Output for 5.5.25
946728732000 1461816087000
Output for 5.5.24
946728732000 1462015965000
Output for 5.4.45
946728732000 1442197446000
Output for 5.4.44
946728732000 1442197444000
Output for 5.4.43
946728732000 1442197440000
Output for 5.4.42
946728732000 1442197439000
Output for 5.4.41
946728732000 1442197437000
Output for 5.4.40
946728732000 1431270426000
Output for 5.4.39
946728732000 1431270425000
Output for 5.4.38
946728732000 1425300394000
Output for 5.4.37
946728732000 1423385101000
Output for 5.4.35 - 5.4.36
946728732000 1423385100000
Output for 5.4.34
946728732000 1423385099000
Output for 5.4.32
946728732000 1410074449000
Output for 5.4.31
946728732000 1410074446000
Output for 5.3.29, 5.4.30
946728732000 1410074443000
Output for 5.4.28 - 5.4.29
946728732000 1410074442000
Output for 5.4.27
946728732000 1410074447000
Output for 5.4.8 - 5.4.26
946728732000 1394508435000
Output for 5.3.16 - 5.3.28, 5.4.0 - 5.4.7
946728732000 1394508436000
Output for 5.3.0 - 5.3.15
946728732000 1394508437000
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::getTimestamp() in /in/1sbdg on line 3
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/1sbdg on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/1sbdg on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/1sbdg on line 2