3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date1 = new DateTime('12-12-2013'); $date2 = new DateTime('now'); $number1 = (int)$date1->format('U'); $number2 = (int)$date2->format('U'); echo $date2->format('Y-m-d H:i:'); echo "<br>"; echo (($number2 - $number1)/60/60) * 24;
based on TdZpK
Output for 5.6.28, 7.0.14 - 7.1.0
2014-10-21 05:05:<br>180386.08
Output for 7.0.6
2016-05-03 10:29:<br>503075.64666667
Output for 7.0.5
2016-04-02 23:14:<br>485525.9
Output for 7.0.4
2016-03-10 09:51:<br>471980.71333333
Output for 7.0.3
2016-03-18 10:31:<br>476604.77333333
Output for 7.0.2
2016-03-22 16:30:<br>479052.11333333
Output for 7.0.1
2016-03-23 21:05:<br>479738.11333333
Output for 7.0.0
2016-03-26 22:37:<br>481502.96666667
Output for hhvm-3.12.0
2016-03-12 13:19:<br>473215.9
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.21
2016-05-02 05:48:<br>502387.32
Output for 5.6.20
2016-04-09 22:14:<br>489533.81333333
Output for 5.6.19
2016-03-07 17:58:<br>470447.56666667
Output for 5.6.18
2016-03-15 02:06:<br>474674.44
Output for 5.6.17
2016-03-19 14:45:<br>477282.15333333
Output for 5.6.16
2016-03-28 00:34:<br>482101.88666667
Output for 5.6.15
2016-03-29 01:29:<br>482699.98666667
Output for 5.6.14
2016-04-02 03:48:<br>485059.49333333
Output for 5.6.13
2016-04-15 07:43:<br>492641.32666667
Output for 5.6.12
2016-04-19 21:31:<br>495276.74
Output for 5.6.11
2016-04-23 04:33:<br>497173.45333333
Output for 5.6.10
2016-04-25 06:18:<br>498367.39333333
Output for 5.6.9
2016-04-27 11:17:<br>499639.01333333
Output for 5.6.8
2016-04-29 19:26:<br>500986.51333333
Output for 5.5.35
2016-05-22 09:36:<br>513998.46666667
Output for 5.5.34
2016-04-11 00:34:<br>490165.99333333
Output for 5.5.33
2016-03-08 20:55:<br>471094.35333333
Output for 5.5.32
2016-03-17 03:39:<br>475863.74666667
Output for 5.5.31
2016-03-20 17:30:<br>477924.19333333
Output for 5.5.30
2016-04-01 03:26:<br>484474.68666667
Output for 5.5.29
2016-04-16 21:50:<br>493556.24666667
Output for 5.5.28
2016-04-21 00:48:<br>495931.25333333
Output for 5.5.27
2016-04-22 03:05:<br>496562.34
Output for 5.5.26
2016-04-26 08:45:<br>499002.14666667
Output for 5.5.25
2016-04-28 15:09:<br>500307.93333333
Output for 5.5.24
2016-05-23 22:23:<br>514881.57333333
Output for 5.4.45
2015-09-21 15:15:<br>373590.26666667
Output for 5.4.44
2015-09-21 15:15:<br>373590.24
Output for 5.4.43
2015-09-21 15:15:<br>373590.2
Output for 5.4.42
2015-07-09 12:18:<br>330895.36
Output for 5.4.41
2015-07-09 12:18:<br>330895.34666667
Output for 5.4.39 - 5.4.40
2015-07-09 12:18:<br>330895.32
Output for 5.4.38
2015-07-09 12:18:<br>330895.30666667
Output for 5.4.36 - 5.4.37
2015-07-09 12:18:<br>330895.29333333
Output for 5.4.35
2015-07-09 12:18:<br>330895.28666667
Output for 5.4.24 - 5.4.34
2014-10-21 05:05:<br>180386.10666667
Output for 5.4.2 - 5.4.23
2014-10-21 05:05:<br>180386.11333333
Output for 5.3.11 - 5.4.1
2014-10-21 05:05:<br>180386.12
Output for 5.2.5 - 5.3.10
2014-10-21 05:05:<br>180386.12666667
Output for 5.2.0 - 5.2.4
2014-10-21 05:05:<br>180386.13333333
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/ZtXqa on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/ZtXqa on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/ZtXqa on line 3