3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 06:19:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: Undefined property: DateTime::$date in /in/fMr6L on line 5 Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/fMr6L on line 5 2014-04-26
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 06:19:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: Undefined property: DateTime::$date in /in/fMr6L on line 5 2014-04-26
Output for 8.0.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 04:19:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } Warning: Undefined property: DateTime::$date in /in/fMr6L on line 5 2014-04-26
Output for 7.4.0 - 7.4.33
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 06:19:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Undefined property: DateTime::$date in /in/fMr6L on line 5 2014-04-26
Output for 7.3.32 - 7.3.33
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 04:19:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } 2014-05-05
Output for 5.6.28, 7.0.14 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31
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 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.3.1 - 5.3.2, 5.3.4, 5.3.6 - 5.3.7, 5.3.9, 5.3.12 - 5.3.13, 5.3.15 - 5.3.17, 5.3.19 - 5.3.24, 5.3.27 - 5.3.28, 5.4.0, 5.4.2, 5.4.6, 5.4.8 - 5.4.9, 5.4.11 - 5.4.27
object(DateTime)#1 (3) { ["date"]=> string(19) "2014-05-04 06:19:53" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } 2014-05-05
Output for 5.3.0, 5.3.3, 5.3.5, 5.3.8, 5.3.10 - 5.3.11, 5.3.14, 5.3.18, 5.3.25 - 5.3.26, 5.4.1, 5.4.3 - 5.4.5, 5.4.7, 5.4.10
object(DateTime)#1 (3) { ["date"]=> string(19) "2014-05-04 06:19:52" ["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.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.0.5, 5.1.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.3.11, 4.4.0 - 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

preferences:
186.64 ms | 401 KiB | 328 Q