3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $sdate = DateTime::createFromFormat('d/m/Y', '04/05/2014'); var_dump($sdate); $date = new DateTime($sdate->date); $date->add(new DateInterval('P1D')); echo $date->format('Y-m-d');
Output for 5.6.28, 7.0.14 - 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 06:19:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 7.0.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 16:45:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 7.0.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 05:15:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 7.0.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 16:52:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 7.0.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 17:37:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 7.0.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 23:44:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 7.0.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 03:54:57.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 7.0.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 05:51:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for hhvm-3.12.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 02:37:47.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Undefined property: DateTime::$date in /in/fMr6L on line 5 2016-03-14
Output for hhvm-3.10.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 22:51:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Undefined property: DateTime::$date in /in/fMr6L on line 5 2016-03-31
Output for 5.6.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 11:55:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.6.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 04:14:22.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.6.19
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 00:41:05.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.6.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 09:32:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.6.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 21:26:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.6.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 06:39:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.6.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 07:30:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.6.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 09:27:01.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.6.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 13:44:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.6.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 04:10:36.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.6.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 10:41:01.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.6.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 12:36:22.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.6.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 17:44:36.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.6.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 02:28:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.5.35
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 17:38:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.5.34
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 06:28:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.5.33
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 03:41:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.5.32
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 13:15:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.5.31
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 00:17:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.5.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 09:24:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.5.29
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 04:08:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.5.28
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 07:21:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.5.27
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 09:16:18.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.5.26
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 15:17:37.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.5.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 22:08:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.5.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 04:50:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.4.45
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 23:11:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.4.44
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 23:11:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.4.43
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 07:47:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.4.42
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 07:46:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.4.41
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 13:33:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.4.40
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 13:33:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.4.39
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 13:33:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.4.38
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 23:09:18.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.4.36 - 5.4.37
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 06:18:47.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.4.34 - 5.4.35
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 06:18:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.4.32
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 11:12:34.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.4.31
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 11:12:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.4.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 11:12:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.4.28 - 5.4.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2014-05-04 11:12:27" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.4.27
object(DateTime)#1 (3) { ["date"]=> string(19) "2014-05-04 06:19:54" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.4.7 - 5.4.26
object(DateTime)#1 (3) { ["date"]=> string(19) "2014-05-04 06:19:55" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.3.15 - 5.3.28, 5.4.0 - 5.4.6
object(DateTime)#1 (3) { ["date"]=> string(19) "2014-05-04 06:19:56" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.3.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2014-05-04 11:12:28" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.3.0 - 5.3.14
object(DateTime)#1 (3) { ["date"]=> string(19) "2014-05-04 06:19:57" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.2.10 - 5.2.17
Fatal error: Call to undefined method DateTime::createFromFormat() in /in/fMr6L on line 3
Process exited with code 255.
Output for 5.2.0 - 5.2.9
Fatal error: Call to undefined method DateTime::createfromformat() in /in/fMr6L on line 3
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/fMr6L on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Undefined class name 'datetime' in /in/fMr6L on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Undefined class name 'datetime' in /in/fMr6L on line 3