3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo (new DateTimeImmutable())->modify('this month')->format('Y-m-d H:i:s');
Output for 5.6.28, 7.0.20 - 7.2.0
2016-01-18 10:41:35
Output for 7.0.6
2016-05-21 13:57:02
Output for 7.0.5
2016-04-03 09:53:16
Output for 7.0.4
2016-03-10 22:00:49
Output for 7.0.3
2016-03-18 23:35:29
Output for 7.0.2
2016-03-23 05:43:08
Output for 7.0.1
2016-03-24 08:45:40
Output for 7.0.0
2016-03-27 10:38:34
Output for 5.6.21
2016-05-02 16:47:50
Output for 5.6.20
2016-04-10 08:55:41
Output for 5.6.19
2016-03-08 06:10:56
Output for 5.6.18
2016-03-15 15:09:34
Output for 5.6.17
2016-03-20 02:41:35
Output for 5.6.16
2016-03-28 11:28:25
Output for 5.6.15
2016-03-29 12:18:03
Output for 5.6.14
2016-04-14 18:00:26
Output for 5.6.13
2016-04-15 18:39:18
Output for 5.6.12
2016-04-20 09:09:52
Output for 5.6.11
2016-04-24 15:35:50
Output for 5.6.10
2016-04-25 17:41:33
Output for 5.6.9
2016-04-27 23:09:40
Output for 5.6.8
2016-04-30 07:36:05
Output for 5.5.35
2016-05-23 02:52:47
Output for 5.5.34
2016-04-11 11:10:33
Output for 5.5.33
2016-03-09 09:15:59
Output for 5.5.32
2016-03-17 19:08:17
Output for 5.5.31
2016-03-21 05:54:28
Output for 5.5.30
2016-04-01 14:09:23
Output for 5.5.29
2016-04-17 08:57:13
Output for 5.5.28
2016-04-21 12:29:26
Output for 5.5.27
2016-04-22 14:07:01
Output for 5.5.26
2016-04-26 20:23:01
Output for 5.5.25
2016-04-29 03:49:35
Output for 5.5.24
2016-05-24 10:21:17
Output for 5.4.12 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/tKM5a on line 3
Process exited with code 255.
Output for 5.3.22 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/tKM5a on line 3
Process exited with code 255.