3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new \DateTime('1994'); echo $date->format('Y-m-d H:i:s') . "\n"; $date = new \DateTime('1994-01'); echo $date->format('Y-m-d H:i:s') . "\n"; $date = new \DateTime('1994-01-01'); echo $date->format('Y-m-d H:i:s') . "\n";
Output for 5.6.28, 7.0.14 - 7.1.0
1994-10-11 16:31:02 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.5.34 - 5.5.35, 5.6.21, 7.0.6
1994-05-21 10:06:08 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.5.33, 5.6.19 - 5.6.20, hhvm-3.12.0, 7.0.4 - 7.0.5
1994-05-21 10:06:09 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.5.31 - 5.5.32, 5.6.17 - 5.6.18, 7.0.1 - 7.0.3
1994-05-21 10:06:10 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.6.14 - 5.6.16, hhvm-3.10.0, 7.0.0
1994-05-21 10:06:11 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.4.45, 5.5.28 - 5.5.30, 5.6.13
1994-05-21 10:06:12 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.4.42 - 5.4.44, 5.5.27, 5.6.10 - 5.6.12
1994-05-21 10:06:13 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.4.41, 5.5.24 - 5.5.26, 5.6.8 - 5.6.9
1994-05-21 10:06:14 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.4.38 - 5.4.40, 5.5.23, 5.6.6 - 5.6.7
1994-05-21 10:06:15 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.4.36 - 5.4.37, 5.5.20 - 5.5.22, 5.6.4 - 5.6.5
1994-05-21 10:06:16 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.4.34 - 5.4.35, 5.5.18 - 5.5.19, 5.6.1 - 5.6.3
1994-05-21 10:06:17 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.3.29, 5.4.31 - 5.4.32, 5.5.14 - 5.5.16, 5.6.0
1994-05-21 10:06:18 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.4.27 - 5.4.30, 5.5.11 - 5.5.13
1994-05-21 10:06:19 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.4.23 - 5.4.26, 5.5.8 - 5.5.10
1994-05-21 10:06:20 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.3.28, 5.4.20 - 5.4.22, 5.5.5 - 5.5.7
1994-05-21 10:06:21 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.3.27, 5.4.18 - 5.4.19, 5.5.1 - 5.5.4
1994-05-21 10:06:22 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.3.25 - 5.3.26, 5.4.14 - 5.4.17, 5.5.0
1994-05-21 10:06:23 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.3.21 - 5.3.24, 5.4.11 - 5.4.13
1994-05-21 10:06:24 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.3.17 - 5.3.20, 5.4.8 - 5.4.10
1994-05-21 10:06:25 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.3.14 - 5.3.16, 5.4.3 - 5.4.7
1994-05-21 10:06:26 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.3.10 - 5.3.13, 5.4.0 - 5.4.2
1994-05-21 10:06:27 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.3.4 - 5.3.9
1994-05-21 10:06:28 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.3.1 - 5.3.3
1994-05-21 10:06:29 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.3.0
1994-05-21 10:06:30 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.2.16 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 6 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 9 1994-05-21 10:06:28 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.2.12 - 5.2.15
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 6 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 9 1994-05-21 10:06:29 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.2.7 - 5.2.11
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 6 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 9 1994-05-21 10:06:30 1994-01-01 00:00:00 1994-01-01 00:00:00
Output for 5.2.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 6 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 9 1994-05-21 10:06:30 1994-01-21 00:00:00 1994-01-01 00:00:00
Output for 5.2.1 - 5.2.5
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 6 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 9 1994-05-21 10:06:31 1994-01-21 00:00:00 1994-01-01 00:00:00
Output for 5.2.0
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 6 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 9 1994-05-21 10:06:32 1994-01-21 00:00:00 1994-01-01 00:00:00
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 6 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 9 Fatal error: Class 'DateTime' not found in /in/QCtWt on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 6 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 9 Fatal error: Cannot instantiate non-existent class: datetime in /in/QCtWt on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 6 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/QCtWt on line 9 Fatal error: Cannot instantiate non-existent class: datetime in /in/QCtWt on line 3