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()); var_dump(date_create_from_format('Y-m-d H:i:s', '2015-11-10 12:30:00'));
based on 8gI2d
Output for 7.2.0
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:40.003216" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.000000" ["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:40.003849" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.000000" ["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:40.005448" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.000000" ["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:40.013167" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.000000" ["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:40.011487" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.000000" ["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:40.004165" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.000000" ["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:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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:58.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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:41.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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:42.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.40 - 5.4.42
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.36 - 5.4.39
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.32 - 5.4.35
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:40:47.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.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:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-10 12:30:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.26 - 5.4.29
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:40:48" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-10 12:30:00" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.28, 5.4.21 - 5.4.25
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:40:49" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-10 12:30:00" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.26 - 5.3.27, 5.4.15 - 5.4.20
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:40:50" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-10 12:30:00" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.19 - 5.3.25, 5.4.9 - 5.4.14
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:40:51" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-10 12:30:00" ["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:47" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-10 12:30:00" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }