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 (($number2 - $number1)/60/60) * 24;
based on Ca8LL
Output for 5.6.28, 7.0.14 - 7.1.0
2014-10-21 05:04:180385.9
Output for 7.0.6
2016-05-21 19:55:513670.28
Output for 7.0.5
2016-04-02 13:00:485280.1
Output for 7.0.4
2016-03-09 21:49:471691.98666667
Output for 7.0.3
2016-03-17 22:14:476309.94
Output for 7.0.2
2016-03-21 08:59:478295.73333333
Output for 7.0.1
2016-03-23 08:37:479439.06666667
Output for 7.0.0
2016-03-26 11:50:481244.23333333
Output for hhvm-3.12.0
2016-03-11 00:59:472343.60666667
Output for hhvm-3.10.0
2016-03-29 15:22:483033.04666667
Output for 5.6.21
2016-05-02 21:50:502772.28666667
Output for 5.6.20
2016-04-10 13:28:489899.56
Output for 5.6.19
2016-03-06 18:47:469891.16666667
Output for 5.6.18
2016-03-14 07:14:474221.72666667
Output for 5.6.17
2016-03-19 02:48:476995.28
Output for 5.6.16
2016-03-27 13:32:481837.14666667
Output for 5.6.15
2016-03-28 14:23:482433.26
Output for 5.6.14
2016-04-01 17:16:484806.70666667
Output for 5.6.13
2016-04-15 21:52:492980.97333333
Output for 5.6.12
2016-04-20 12:55:495646.10666667
Output for 5.6.11
2016-04-24 18:49:498091.8
Output for 5.6.10
2016-04-25 20:57:498719.10666667
Output for 5.6.9
2016-04-28 02:56:500014.67333333
Output for 5.6.8
2016-04-30 10:42:501352.92666667
Output for 5.5.35
2016-05-23 11:15:514614.38666667
Output for 5.5.34
2016-04-11 15:45:490530.36
Output for 5.5.33
2016-03-08 08:57:470807.16
Output for 5.5.32
2016-03-15 18:03:475057.26666667
Output for 5.5.31
2016-03-20 05:45:477642.24666667
Output for 5.5.30
2016-03-31 16:35:484214.39333333
Output for 5.5.29
2016-04-17 12:03:493897.22666667
Output for 5.5.28
2016-04-21 15:44:496289.80666667
Output for 5.5.27
2016-04-22 17:15:496902.01333333
Output for 5.5.26
2016-04-26 23:39:499359.71333333
Output for 5.5.25
2016-04-29 07:14:500693.78666667
Output for 5.5.24
2016-05-24 14:21:515264.67333333
Output for 5.4.45
2015-09-21 15:15:373590.26666667
Output for 5.4.44
2015-09-21 15:15:373590.23333333
Output for 5.4.43
2015-09-21 15:15:373590.2
Output for 5.4.42
2015-07-09 12:17:330895.05333333
Output for 5.4.41
2015-07-09 12:17:330895.04666667
Output for 5.4.39 - 5.4.40
2015-07-09 12:17:330895.01333333
Output for 5.4.38
2015-07-09 12:17:330895.00666667
Output for 5.4.37
2015-07-09 12:17:330894.99333333
Output for 5.4.35 - 5.4.36
2015-07-09 12:17:330894.98666667
Output for 5.4.29 - 5.4.34
2014-10-21 05:04:180385.92666667
Output for 5.4.8 - 5.4.28
2014-10-21 05:04:180385.93333333
Output for 5.3.16 - 5.4.7
2014-10-21 05:04:180385.94
Output for 5.2.11 - 5.3.15
2014-10-21 05:04:180385.94666667
Output for 5.2.0 - 5.2.10
2014-10-21 05:04:180385.95333333
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/TdZpK 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/TdZpK 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/TdZpK on line 3