3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dt = new DateTime("first day of this month"); echo $dt->format("Y-m-d H:i:s\n"); $dt->add(new DateInterval("P1D")); echo $dt->format("Y-m-d H:i:s\n");
Output for 7.0.12 - 7.1.0
2013-04-01 09:24:53 2013-04-02 09:24:53
Output for 7.0.6
2016-05-01 00:59:49 2016-05-02 00:59:49
Output for 7.0.5
2016-04-01 14:21:15 2016-04-02 14:21:15
Output for 7.0.4
2016-03-01 23:21:14 2016-03-02 23:21:14
Output for 7.0.3
2016-03-01 23:46:09 2016-03-02 23:46:09
Output for 7.0.2
2016-03-01 10:28:02 2016-03-02 10:28:02
Output for 7.0.1
2016-03-01 10:09:22 2016-03-02 10:09:22
Output for 7.0.0
2016-03-01 13:10:09 2016-03-02 13:10:09
Output for hhvm-3.12.0
2016-03-01 03:10:18 2016-03-02 03:10:18
Output for hhvm-3.10.0
2016-03-01 17:37:26 2016-03-02 17:37:26
Output for 5.6.21
2016-05-01 20:05:22 2016-05-02 20:05:22
Output for 5.6.20
2016-04-01 09:36:19 2016-04-02 09:36:19
Output for 5.6.19
2016-03-01 20:51:28 2016-03-02 20:51:28
Output for 5.6.18
2016-03-01 09:17:08 2016-03-02 09:17:08
Output for 5.6.17
2016-03-01 04:21:22 2016-03-02 04:21:22
Output for 5.6.16
2016-03-01 14:54:48 2016-03-02 14:54:48
Output for 5.6.15
2016-03-01 15:53:45 2016-03-02 15:53:45
Output for 5.6.14
2016-04-01 18:36:07 2016-04-02 18:36:07
Output for 5.6.13
2016-04-01 22:29:11 2016-04-02 22:29:11
Output for 5.6.12
2016-04-01 11:33:59 2016-04-02 11:33:59
Output for 5.6.11
2016-04-01 18:51:31 2016-04-02 18:51:31
Output for 5.6.10
2016-04-01 20:30:18 2016-04-02 20:30:18
Output for 5.6.9
2016-04-01 01:35:36 2016-04-02 01:35:36
Output for 5.6.8
2016-04-01 09:09:43 2016-04-02 09:09:43
Output for 5.6.7
2016-05-01 19:05:12 2016-05-02 19:05:12
Output for 5.5.35
2016-05-01 23:09:33 2016-05-02 23:09:33
Output for 5.5.34
2016-04-01 15:27:30 2016-04-02 15:27:30
Output for 5.5.33
2016-03-01 10:35:17 2016-03-02 10:35:17
Output for 5.5.32
2016-03-01 19:34:28 2016-03-02 19:34:28
Output for 5.5.31
2016-03-01 07:15:22 2016-03-02 07:15:22
Output for 5.5.30
2016-03-01 17:57:37 2016-03-02 17:57:37
Output for 5.5.29
2016-04-01 12:32:52 2016-04-02 12:32:52
Output for 5.5.28
2016-04-01 14:44:28 2016-04-02 14:44:28
Output for 5.5.27
2016-04-01 17:22:45 2016-04-02 17:22:45
Output for 5.5.26
2016-04-01 22:45:05 2016-04-02 22:45:05
Output for 5.5.25
2016-04-01 04:51:57 2016-04-02 04:51:57
Output for 5.5.24
2016-04-01 12:29:47 2016-04-02 12:29:47
Output for 5.4.45
2016-02-01 23:17:09 2016-02-02 23:17:09
Output for 5.4.43 - 5.4.44
2016-02-01 23:17:10 2016-02-02 23:17:10
Output for 5.4.41 - 5.4.42
2016-02-01 23:17:11 2016-02-02 23:17:11
Output for 5.4.39 - 5.4.40
2016-02-01 23:17:12 2016-02-02 23:17:12
Output for 5.4.37 - 5.4.38
2016-02-01 23:17:13 2016-02-02 23:17:13
Output for 5.4.34 - 5.4.36
2016-02-01 23:17:14 2016-02-02 23:17:14
Output for 5.3.29, 5.4.31 - 5.4.32
2016-02-01 23:17:15 2016-02-02 23:17:15
Output for 5.4.27 - 5.4.30
2016-02-01 23:17:16 2016-02-02 23:17:16
Output for 5.4.24 - 5.4.26
2016-02-01 23:17:17 2016-02-02 23:17:17
Output for 5.3.28, 5.4.21 - 5.4.23
2016-02-01 23:17:18 2016-02-02 23:17:18
Output for 5.4.18 - 5.4.20
2016-02-01 23:17:19 2016-02-02 23:17:19
Output for 5.3.25 - 5.3.27, 5.4.15 - 5.4.17
2016-02-01 23:17:20 2016-02-02 23:17:20
Output for 5.3.21 - 5.3.24, 5.4.12 - 5.4.14
2016-02-01 23:17:21 2016-02-02 23:17:21
Output for 5.3.18 - 5.3.20, 5.4.8 - 5.4.11
2016-02-01 23:17:22 2016-02-02 23:17:22
Output for 5.3.14 - 5.3.17, 5.4.5 - 5.4.7
2016-02-01 23:17:23 2016-02-02 23:17:23
Output for 5.3.11 - 5.3.13, 5.4.0 - 5.4.4
2016-02-01 23:17:24 2016-02-02 23:17:24
Output for 5.3.7 - 5.3.10
2016-02-01 23:17:25 2016-02-02 23:17:25
Output for 5.3.5 - 5.3.6
2016-02-01 23:17:25 2016-02-01 23:17:25
Output for 5.3.1 - 5.3.4
2016-02-01 23:17:26 2016-02-01 23:17:26
Output for 5.3.0
2016-02-01 23:17:27 2016-02-01 23:17:27
Output for 5.2.0 - 5.2.17
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (first day of this month) at position 10 (o): The timezone could not be found in the database' in /in/18hPB:2 Stack trace: #0 /in/18hPB(2): DateTime->__construct('first day of th...') #1 {main} thrown in /in/18hPB on line 2
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/18hPB on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/18hPB on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/18hPB on line 2