3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump( date_diff(date_create_from_format('Y-m-d H:i:s', '2015-11-10 12:30:00'), date_create('now'))->format('d') ); var_dump(date_create('now'));
based on U4Usa
Output for 7.2.0
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:14.005079" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.10
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:14.005247" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:14.004076" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:14.012482" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:14.005715" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:14.003995" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.28, 7.0.20
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.6
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-03 18:40:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.5
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-03 07:04:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.4
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-10 18:52:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.3
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-18 20:04:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.2
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-23 02:10:38.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.1
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-24 05:47:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.0
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-27 07:43:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.21
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-02 13:49:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.20
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-10 06:04:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.19
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-08 03:04:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.18
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-15 11:48:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.17
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-19 23:26:57.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.16
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-28 08:30:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.15
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-29 09:21:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.14
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-02 11:11:57.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.13
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-15 15:37:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.12
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-20 06:06:36.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.11
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-24 12:29:37.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.10
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-25 14:31:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.9
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-27 19:41:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.8
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-30 04:33:42.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.35
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-22 21:18:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.34
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-11 08:15:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.33
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-09 05:48:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.32
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-17 15:43:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.31
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-21 02:29:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.30
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-01 11:15:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.29
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-17 06:00:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.28
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-21 09:20:38.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.27
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-22 11:06:42.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.26
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-26 17:14:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.25
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-29 00:10:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.24
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-24 06:39:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.45
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.44
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:17.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.43
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:18.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.41 - 5.4.42
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.40
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:20.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.38 - 5.4.39
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.36 - 5.4.37
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:22.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.34 - 5.4.35
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.32
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30 - 5.4.31
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.29
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:40:25" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.27 - 5.4.28
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:40:26" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.25 - 5.4.26
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:40:27" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.28, 5.4.23 - 5.4.24
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:40:28" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.20 - 5.4.22
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:40:29" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.27, 5.4.17 - 5.4.19
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:40:30" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.23 - 5.3.26, 5.4.13 - 5.4.16
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:40:31" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.19 - 5.3.22, 5.4.9 - 5.4.12
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:40:32" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.29
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:40:24" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }