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 ""; echo (($number2 - $number1)/60/60) * 24;
based on ZtXqa
Output for 5.6.28, 7.0.14 - 7.1.0
2014-10-21 05:05:180386.2
Output for 7.0.6
2016-05-03 05:56:502966.48666667
Output for 7.0.5
2016-04-02 19:00:485424.21333333
Output for 7.0.4
2016-03-10 04:58:471863.52666667
Output for 7.0.3
2016-03-18 05:21:476480.57333333
Output for 7.0.2
2016-03-21 15:48:478459.2
Output for 7.0.1
2016-03-23 16:24:479625.69333333
Output for 7.0.0
2016-03-26 18:09:481395.81333333
Output for hhvm-3.12.0
2016-04-01 03:36:484478.52
Output for hhvm-3.10.0
2016-03-30 02:36:483302.49333333
Output for 5.6.21
2016-05-02 01:11:502276.48
Output for 5.6.20
2016-04-09 14:17:489342.86
Output for 5.6.19
2016-03-07 05:03:470137.49333333
Output for 5.6.18
2016-03-14 18:01:474480.49333333
Output for 5.6.17
2016-03-19 09:44:477161.67333333
Output for 5.6.16
2016-03-27 19:55:481990.14666667
Output for 5.6.15
2016-03-28 20:48:482587.24666667
Output for 5.6.14
2016-04-01 23:18:484951.52666667
Output for 5.6.13
2016-04-15 03:20:492536.31333333
Output for 5.6.12
2016-04-19 16:50:495164
Output for 5.6.11
2016-04-22 23:45:497058.02666667
Output for 5.6.10
2016-04-25 01:37:498255.19333333
Output for 5.6.9
2016-04-27 06:38:499527.39333333
Output for 5.6.8
2016-04-29 14:29:500867.98666667
Output for 5.6.7
2016-05-25 04:41:515608.77333333
Output for 5.5.35
2016-05-22 04:48:513883.23333333
Output for 5.5.34
2016-04-10 20:14:490061.7
Output for 5.5.33
2016-03-08 15:54:470973.68
Output for 5.5.32
2016-03-16 21:51:475724.46666667
Output for 5.5.31
2016-03-20 12:34:477805.95333333
Output for 5.5.30
2016-03-31 22:49:484363.72666667
Output for 5.5.29
2016-04-16 17:26:493450.48
Output for 5.5.28
2016-04-20 19:52:495812.97333333
Output for 5.5.27
2016-04-21 22:11:496444.48666667
Output for 5.5.26
2016-04-26 04:01:498888.77333333
Output for 5.5.25
2016-04-28 09:59:500183.81333333
Output for 5.5.24
2016-05-23 16:57:514751.17333333
Output for 5.4.45
2015-09-21 15:15:373590.26666667
Output for 5.4.44
2015-09-21 15:15:373590.24
Output for 5.4.43
2015-09-21 15:15:373590.2
Output for 5.4.42
2015-07-09 12:18:330895.45333333
Output for 5.4.41
2015-07-09 12:18:330895.44
Output for 5.4.40
2015-07-09 12:18:330895.41333333
Output for 5.4.39
2015-07-09 12:18:330895.40666667
Output for 5.4.38
2015-07-09 12:18:330895.4
Output for 5.4.37
2015-07-09 12:18:330895.38666667
Output for 5.4.35 - 5.4.36
2015-07-09 12:18:330895.38
Output for 5.4.17 - 5.4.34
2014-10-21 05:05:180386.23333333
Output for 5.3.25 - 5.4.16
2014-10-21 05:05:180386.24
Output for 5.3.3 - 5.3.24
2014-10-21 05:05:180386.24666667
Output for 5.2.0 - 5.3.2
2014-10-21 05:05:180386.25333333
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/dfGP0 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/dfGP0 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/dfGP0 on line 3