3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php date_default_timezone_set('Asia/Singapore'); $end_date = new DateTime(); $end_date->modify('first day of next month'); echo $end_date->format('Y-m-d H:i:s');
Output for 7.0.14 - 7.1.0
2014-08-01 14:21:16
Output for 7.0.6
2016-06-01 15:38:11
Output for 7.0.5
2016-05-01 04:30:46
Output for 7.0.4
2016-04-01 16:02:35
Output for 7.0.3
2016-04-01 16:39:29
Output for 7.0.2
2016-04-01 22:33:17
Output for 7.0.1
2016-04-01 03:19:03
Output for 7.0.0
2016-04-01 04:51:50
Output for hhvm-3.12.0
2016-04-01 13:43:40
Output for hhvm-3.10.0
2016-04-01 17:06:23
Output for 5.6.21
2016-06-01 10:59:57
Output for 5.6.20
2016-05-01 03:27:30
Output for 5.6.19
2016-04-01 00:10:53
Output for 5.6.18
2016-04-01 08:04:35
Output for 5.6.17
2016-04-01 20:55:11
Output for 5.6.16
2016-04-01 05:37:08
Output for 5.6.15
2016-04-01 06:42:20
Output for 5.6.14
2016-05-01 09:03:20
Output for 5.6.13
2016-05-01 12:57:31
Output for 5.6.12
2016-05-01 02:41:53
Output for 5.6.11
2016-05-01 09:45:58
Output for 5.6.10
2016-05-01 11:29:35
Output for 5.6.9
2016-05-01 16:27:51
Output for 5.6.8
2016-05-01 00:32:20
Output for 5.5.35
2016-06-01 14:43:28
Output for 5.5.34
2016-05-01 05:47:51
Output for 5.5.33
2016-04-01 03:07:49
Output for 5.5.32
2016-04-01 09:47:56
Output for 5.5.31
2016-04-01 23:41:01
Output for 5.5.30
2016-05-01 08:38:03
Output for 5.5.29
2016-05-01 03:03:06
Output for 5.5.28
2016-05-01 05:47:12
Output for 5.5.27
2016-05-01 08:16:45
Output for 5.5.26
2016-05-01 13:56:34
Output for 5.5.25
2016-05-01 20:14:40
Output for 5.5.24
2016-06-01 03:32:19
Output for 5.4.45
2015-10-01 06:30:22
Output for 5.4.44
2015-10-01 06:30:14
Output for 5.4.43
2015-10-01 06:30:03
Output for 5.4.42
2015-10-01 06:30:00
Output for 5.4.41
2015-10-01 06:29:55
Output for 5.4.40
2015-10-01 06:29:51
Output for 5.4.39
2015-10-01 06:29:48
Output for 5.4.38
2015-04-01 22:22:50
Output for 5.4.36 - 5.4.37
2015-04-01 22:22:41
Output for 5.4.34 - 5.4.35
2015-04-01 22:22:40
Output for 5.4.31 - 5.4.32
2014-10-01 18:23:45
Output for 5.4.22 - 5.4.30
2014-08-01 14:21:22
Output for 5.4.4 - 5.4.21
2014-08-01 14:21:23
Output for 5.3.17 - 5.3.28, 5.4.0 - 5.4.3
2014-08-01 14:21:24
Output for 5.3.29
2014-10-01 18:23:44
Output for 5.3.0 - 5.3.16
2014-08-01 14:21:25
Output for 5.2.17
Warning: DateTime::modify(): Failed to parse time string (first day of next month) at position 10 (o): The timezone could not be found in the database in /in/ZLLDe on line 5 2014-07-07 14:21:25
Output for 5.2.13 - 5.2.16
Warning: DateTime::modify(): Failed to parse time string (first day of next month) at position 10 (o): The timezone could not be found in the database in /in/ZLLDe on line 5 2014-07-07 14:21:26
Output for 5.2.3 - 5.2.12
2014-08-08 14:21:26
Output for 5.2.0 - 5.2.2
2014-08-08 14:21:27
Output for 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/ZLLDe on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_set() in /in/ZLLDe on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_default_timezone_set() in /in/ZLLDe on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_default_timezone_set() in /in/ZLLDe on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_default_timezone_set() in /in/ZLLDe on line 2