3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime(''); $i = new DateInterval('P1Y'); $end = new DateTime('-1 year'); while ($date >= $end) { echo $date->format('c') . PHP_EOL; $date = $date->sub($i); }
Output for 7.1.0
2014-04-29T15:44:46+02:00
Output for 5.6.28, 7.0.14
2014-04-29T15:44:46+02:00 2013-04-29T15:44:46+02:00
Output for 7.0.6
2016-05-03T02:42:05+02:00 2015-05-03T02:42:05+02:00
Output for 7.0.5
2016-04-02T15:57:58+02:00 2015-04-02T15:57:58+02:00
Output for 7.0.4
2016-03-10T01:30:58+01:00 2015-03-10T01:30:58+01:00
Output for 7.0.3
2016-03-18T01:41:11+01:00 2015-03-18T01:41:11+01:00
Output for 7.0.2
2016-03-21T12:15:53+01:00 2015-03-21T12:15:53+01:00
Output for 7.0.1
2016-03-23T12:28:51+01:00 2015-03-23T12:28:51+01:00
Output for 7.0.0
2016-03-26T14:55:59+01:00 2015-03-26T14:55:59+01:00
Output for hhvm-3.12.0
2016-03-29T17:50:18+02:00 2015-03-29T17:50:18+02:00
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.21
2016-05-01T21:44:09+02:00 2015-05-01T21:44:09+02:00
Output for 5.6.20
2016-04-09T11:10:16+02:00 2015-04-09T11:10:16+02:00
Output for 5.6.19
2016-03-06T23:47:43+01:00 2015-03-06T23:47:43+01:00
Output for 5.6.18
2016-03-14T12:09:09+01:00 2015-03-14T12:09:09+01:00
Output for 5.6.17
2016-03-19T06:10:01+01:00 2015-03-19T06:10:01+01:00
Output for 5.6.16
2016-03-27T16:40:39+02:00 2015-03-27T16:40:39+01:00
Output for 5.6.15
2016-03-28T17:34:12+02:00 2015-03-28T17:34:12+01:00
Output for 5.6.14
2016-04-01T20:11:48+02:00 2015-04-01T20:11:48+02:00
Output for 5.6.13
2016-04-14T23:59:58+02:00 2015-04-14T23:59:58+02:00
Output for 5.6.12
2016-04-19T13:10:35+02:00 2015-04-19T13:10:35+02:00
Output for 5.6.11
2016-04-22T20:26:33+02:00 2015-04-22T20:26:33+02:00
Output for 5.6.10
2016-04-24T22:06:26+02:00 2015-04-24T22:06:26+02:00
Output for 5.6.9
2016-04-27T03:16:50+02:00 2015-04-27T03:16:50+02:00
Output for 5.6.8
2016-04-29T10:51:45+02:00 2015-04-29T10:51:45+02:00
Output for 5.6.7
2016-05-24T21:54:17+02:00 2015-05-24T21:54:17+02:00
Output for 5.5.35
2016-05-22T01:07:24+02:00 2015-05-22T01:07:24+02:00
Output for 5.5.34
2016-04-10T17:06:40+02:00 2015-04-10T17:06:40+02:00
Output for 5.5.33
2016-03-08T12:21:36+01:00 2015-03-08T12:21:36+01:00
Output for 5.5.32
2016-03-16T18:04:11+01:00 2015-03-16T18:04:11+01:00
Output for 5.5.31
2016-03-20T09:02:31+01:00 2015-03-20T09:02:31+01:00
Output for 5.5.30
2016-03-31T19:35:34+02:00 2015-03-31T19:35:34+02:00
Output for 5.5.29
2016-04-16T14:07:53+02:00 2015-04-16T14:07:53+02:00
Output for 5.5.28
2016-04-20T16:27:11+02:00 2015-04-20T16:27:11+02:00
Output for 5.5.27
2016-04-21T18:57:10+02:00 2015-04-21T18:57:10+02:00
Output for 5.5.26
2016-04-26T00:25:38+02:00 2015-04-26T00:25:38+02:00
Output for 5.5.25
2016-04-28T06:33:20+02:00 2015-04-28T06:33:20+02:00
Output for 5.5.24
2016-04-30T14:02:42+02:00 2015-04-30T14:02:42+02:00
Output for 5.4.45
2015-10-12T12:10:30+02:00 2014-10-12T12:10:30+02:00
Output for 5.4.43 - 5.4.44
2015-10-12T12:10:31+02:00 2014-10-12T12:10:31+02:00
Output for 5.4.40 - 5.4.42
2015-10-12T12:10:32+02:00 2014-10-12T12:10:32+02:00
Output for 5.4.37 - 5.4.39
2015-10-12T12:10:33+02:00 2014-10-12T12:10:33+02:00
Output for 5.4.34 - 5.4.36
2015-10-12T12:10:34+02:00 2014-10-12T12:10:34+02:00
Output for 5.4.28 - 5.4.32
2015-10-12T12:10:35+02:00 2014-10-12T12:10:35+02:00
Output for 5.4.24 - 5.4.27
2015-10-12T12:10:36+02:00 2014-10-12T12:10:36+02:00
Output for 5.4.22 - 5.4.23
2015-10-12T12:10:37+02:00 2014-10-12T12:10:37+02:00
Output for 5.4.19 - 5.4.21
2015-10-12T12:10:38+02:00 2014-10-12T12:10:38+02:00
Output for 5.4.16 - 5.4.18
2015-10-12T12:10:39+02:00 2014-10-12T12:10:39+02:00
Output for 5.4.13 - 5.4.15
2015-10-12T12:10:40+02:00 2014-10-12T12:10:40+02:00
Output for 5.4.10 - 5.4.12
2015-10-12T12:10:41+02:00 2014-10-12T12:10:41+02:00
Output for 5.4.8 - 5.4.9
2015-10-12T12:10:42+02:00 2014-10-12T12:10:42+02:00
Output for 5.4.5 - 5.4.7
2015-10-12T12:10:43+02:00 2014-10-12T12:10:43+02:00
Output for 5.4.2 - 5.4.4
2015-10-12T12:10:44+02:00 2014-10-12T12:10:44+02:00
Output for 5.3.29 - 5.4.1
2015-10-12T12:10:45+02:00 2014-10-12T12:10:45+02:00
Output for 5.3.27 - 5.3.28
2015-10-12T12:10:46+02:00 2014-10-12T12:10:46+02:00
Output for 5.3.24 - 5.3.26
2015-10-12T12:10:47+02:00 2014-10-12T12:10:47+02:00
Output for 5.3.21 - 5.3.23
2015-10-12T12:10:48+02:00 2014-10-12T12:10:48+02:00
Output for 5.3.18 - 5.3.20
2015-10-12T12:10:49+02:00 2014-10-12T12:10:49+02:00
Output for 5.3.15 - 5.3.17
2015-10-12T12:10:50+02:00 2014-10-12T12:10:50+02:00
Output for 5.3.13 - 5.3.14
2015-10-12T12:10:51+02:00 2014-10-12T12:10:51+02:00
Output for 5.3.10 - 5.3.12
2015-10-12T12:10:52+02:00 2014-10-12T12:10:52+02:00
Output for 5.3.7 - 5.3.9
2015-10-12T12:10:53+02:00 2014-10-12T12:10:53+02:00
Output for 5.3.4 - 5.3.6
2015-10-12T12:10:54+02:00 2014-10-12T12:10:54+02:00
Output for 5.3.1 - 5.3.3
2015-10-12T12:10:55+02:00 2014-10-12T12:10:55+02:00
Output for 5.3.0
2015-10-12T12:10:56+02:00 2014-10-12T12:10:56+02:00
Output for 5.2.0 - 5.2.17
Fatal error: Class 'DateInterval' not found in /in/Quk7S on line 3
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/Quk7S 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/Quk7S 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/Quk7S on line 2