3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $from = new \DateTime('1990'); var_dump($from);
Output for 5.6.28, 7.0.14 - 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-10-06 14:00:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.6
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-05-03 10:18:37.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.5
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-04-02 23:05:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.4
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-03-10 09:41:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.3
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-03-18 10:21:01.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.2
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-03-22 16:19:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.1
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-03-23 20:55:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.0
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-03-26 22:27:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.21
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-05-02 05:38:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.20
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-04-09 22:05:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.19
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-03-07 17:48:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.18
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-03-15 01:54:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.17
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-03-19 14:34:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.16
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-03-28 00:15:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.15
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-03-29 01:20:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.14
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-04-02 03:39:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.13
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-04-15 07:33:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.12
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-04-19 21:21:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.11
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-04-23 04:23:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.10
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-04-25 06:08:38.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.9
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-04-27 11:07:36.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.8
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-04-29 19:15:47.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.35
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-05-22 09:26:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.34
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-04-11 00:24:34.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.33
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-03-08 20:45:57.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.32
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-03-17 03:28:34.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.31
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-03-20 17:20:15.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.30
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-04-01 03:16:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.29
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-04-16 21:40:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.28
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-04-21 00:37:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.27
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-04-22 02:55:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.26
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-04-26 08:34:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.25
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-04-28 14:53:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.24
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-05-23 22:14:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.45
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-09-20 10:32:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.44
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-08-17 03:45:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.43
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-08-17 03:45:41.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.42
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-08-17 03:45:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.41
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-08-17 03:45:37.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.39 - 5.4.40
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-08-17 03:45:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.38
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-03-15 15:28:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.35 - 5.4.37
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-03-15 15:28:47.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.34
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-03-15 15:28:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30 - 5.4.32
object(DateTime)#1 (3) { ["date"]=> string(26) "1990-10-06 14:00:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.13 - 5.4.29
object(DateTime)#1 (3) { ["date"]=> string(19) "1990-10-06 14:00:46" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.20 - 5.4.12
object(DateTime)#1 (3) { ["date"]=> string(19) "1990-10-06 14:00:47" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.0 - 5.3.19
object(DateTime)#1 (3) { ["date"]=> string(19) "1990-10-06 14:00:48" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/EiQBp on line 2 object(DateTime)#1 (0) { }
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/EiQBp on line 2 Fatal error: Class 'DateTime' not found in /in/EiQBp on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/EiQBp on line 2 Fatal error: Cannot instantiate non-existent class: datetime in /in/EiQBp on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/EiQBp on line 2 Fatal error: Cannot instantiate non-existent class: datetime in /in/EiQBp on line 2