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')); 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'));
based on hmHTV
Output for 7.2.0
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:43:41.003047" ["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" } string(1) "d"
Output for 7.1.10
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:43:41.003494" ["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" } string(1) "d"
Output for 7.1.7
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:43:41.002568" ["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" } string(1) "d"
Output for 7.1.6
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:43:41.011495" ["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" } string(1) "d"
Output for 7.1.5
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:43:41.010168" ["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" } string(1) "d"
Output for 7.1.0
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:43:41.004074" ["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" } string(1) "d"
Output for 5.6.28, 7.0.20
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:43: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" } string(1) "d"
Output for 7.0.6
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-03 18:40: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" } string(1) "d"
Output for 7.0.5
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-03 07:04:54.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" } string(1) "d"
Output for 7.0.4
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-10 18:52:17.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" } string(1) "d"
Output for 7.0.3
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-18 20:04:06.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" } string(1) "d"
Output for 7.0.2
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-23 02: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" } string(1) "d"
Output for 7.0.1
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-24 05:47: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" } string(1) "d"
Output for 7.0.0
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-27 07:43: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" } string(1) "d"
Output for 5.6.21
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-02 13:49:11.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" } string(1) "d"
Output for 5.6.20
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-10 06:04:11.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" } string(1) "d"
Output for 5.6.19
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-08 03:04:18.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" } string(1) "d"
Output for 5.6.18
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-15 11:48:30.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" } string(1) "d"
Output for 5.6.17
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-19 23:27:00.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" } string(1) "d"
Output for 5.6.16
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-28 08:30:34.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" } string(1) "d"
Output for 5.6.15
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-29 09:21: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" } string(1) "d"
Output for 5.6.14
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-02 11:12:00.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" } string(1) "d"
Output for 5.6.13
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-15 15:37:15.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" } string(1) "d"
Output for 5.6.12
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-20 06:06: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" } string(1) "d"
Output for 5.6.11
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-24 12:29: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" } string(1) "d"
Output for 5.6.10
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-25 14:31:55.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" } string(1) "d"
Output for 5.6.9
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-27 19:41: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" } string(1) "d"
Output for 5.6.8
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-30 04:33: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" } string(1) "d"
Output for 5.5.35
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-22 21:18: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" } string(1) "d"
Output for 5.5.34
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-11 08:15: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" } string(1) "d"
Output for 5.5.33
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-09 05:48:59.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" } string(1) "d"
Output for 5.5.32
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-17 15:43:33.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" } string(1) "d"
Output for 5.5.31
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-21 02:29: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" } string(1) "d"
Output for 5.5.30
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-01 11:15:11.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" } string(1) "d"
Output for 5.5.29
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-17 06:00:10.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" } string(1) "d"
Output for 5.5.28
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-21 09:20: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" } string(1) "d"
Output for 5.5.27
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-22 11:06: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" } string(1) "d"
Output for 5.5.26
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-26 17:14: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" } string(1) "d"
Output for 5.5.25
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-29 00:10: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" } string(1) "d"
Output for 5.5.24
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-24 06:39:35.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" } string(1) "d"
Output for 5.4.45
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:43: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" } string(1) "d"
Output for 5.4.43 - 5.4.44
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:43: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" } string(1) "d"
Output for 5.4.40 - 5.4.42
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:43: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" } string(1) "d"
Output for 5.4.37 - 5.4.39
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:43: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" } string(1) "d"
Output for 5.4.34 - 5.4.36
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:43: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" } string(1) "d"
Output for 5.4.30 - 5.4.32
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-11 13:43: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" } string(1) "d"
Output for 5.3.29, 5.4.27 - 5.4.29
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:43: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" } string(1) "d"
Output for 5.3.28, 5.4.21 - 5.4.26
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:43: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" } string(1) "d"
Output for 5.3.27, 5.4.17 - 5.4.20
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:43: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" } string(1) "d"
Output for 5.3.21 - 5.3.26, 5.4.11 - 5.4.16
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:43: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" } string(1) "d"
Output for 5.3.19 - 5.3.20, 5.4.9 - 5.4.10
string(1) "d" object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-11 13:43: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" } string(1) "d"