3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $today = new DateTime('now'); $today_string = $today->format('Y-m-d'); $next_year = clone $today; $next_year->modify( '+1 year' ); $next_year_string = $next_year->format('Y-m-d'); echo $today->format('Y-m-d H:i:s');
Output for 5.6.28, 7.0.14 - 7.1.0
2014-03-19 22:26:57
Output for 7.0.6
2016-05-03 06:53:02
Output for 7.0.5
2016-04-02 19:53:32
Output for 7.0.4
2016-03-10 06:01:20
Output for 7.0.3
2016-03-18 06:28:02
Output for 7.0.2
2016-03-22 11:59:46
Output for 7.0.1
2016-03-23 17:24:02
Output for 7.0.0
2016-03-26 19:06:16
Output for hhvm-3.12.0
2016-03-11 15:07:36
Output for hhvm-3.10.0
2016-03-30 04:01:01
Output for 5.6.21
2016-05-02 02:10:06
Output for 5.6.20
2016-04-09 15:10:15
Output for 5.6.19
2016-03-07 06:59:55
Output for 5.6.18
2016-03-14 20:06:15
Output for 5.6.17
2016-03-19 10:48:42
Output for 5.6.16
2016-03-27 20:51:15
Output for 5.6.15
2016-03-28 21:43:39
Output for 5.6.14
2016-04-02 00:12:12
Output for 5.6.13
2016-04-15 04:16:16
Output for 5.6.12
2016-04-19 17:47:39
Output for 5.6.11
2016-04-23 00:45:53
Output for 5.6.10
2016-04-25 02:37:13
Output for 5.6.9
2016-04-27 07:35:52
Output for 5.6.8
2016-04-29 15:29:33
Output for 5.6.7
2016-05-25 07:21:21
Output for 5.5.35
2016-05-22 05:47:42
Output for 5.5.34
2016-04-10 21:07:57
Output for 5.5.33
2016-03-08 16:55:12
Output for 5.5.32
2016-03-16 22:57:56
Output for 5.5.31
2016-03-20 13:37:28
Output for 5.5.30
2016-03-31 23:43:26
Output for 5.5.29
2016-04-16 18:21:24
Output for 5.5.28
2016-04-20 20:51:31
Output for 5.5.27
2016-04-21 23:18:20
Output for 5.5.26
2016-04-26 05:03:02
Output for 5.5.25
2016-04-28 11:05:43
Output for 5.5.24
2016-05-23 17:59:53
Output for 5.4.45
2015-09-14 06:22:11
Output for 5.4.44
2015-09-14 06:22:09
Output for 5.4.43
2015-09-14 06:22:05
Output for 5.4.42
2015-09-14 06:22:04
Output for 5.4.41
2015-09-14 06:22:02
Output for 5.4.40
2015-05-15 01:43:16
Output for 5.4.39
2015-05-15 01:43:15
Output for 5.4.38
2015-03-02 15:17:44
Output for 5.4.37
2015-02-08 15:46:16
Output for 5.4.34 - 5.4.36
2015-02-08 15:46:15
Output for 5.4.32
2014-09-07 16:04:20
Output for 5.4.31
2014-09-07 16:04:15
Output for 5.4.29 - 5.4.30
2014-09-07 16:04:09
Output for 5.4.28
2014-09-07 16:04:08
Output for 5.4.27
2014-09-07 16:04:16
Output for 5.4.10 - 5.4.26
2014-03-19 22:26:58
Output for 5.3.18 - 5.3.28, 5.4.0 - 5.4.9
2014-03-19 22:26:59
Output for 5.3.29
2014-09-07 16:04:10
Output for 5.2.14 - 5.3.17
2014-03-19 22:27:00
Output for 5.2.0 - 5.2.13
2014-03-19 22:27:01
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/PgnXK on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_VARIABLE in /in/PgnXK on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_VARIABLE in /in/PgnXK on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/PgnXK on line 4
Process exited with code 255.