3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $start = new DateTime(''); $end = new DateTime('+1 year'); $interval = new DateInterval('P1M'); $period = new DatePeriod($start, $interval, $end); foreach ($period as $dt) { echo $dt->format('Y F').PHP_EOL; }
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.27, 5.6.28, 7.0.14 - 7.1.0
2014 April 2014 May 2014 June 2014 July 2014 August 2014 September 2014 October 2014 November 2014 December 2015 January 2015 March 2015 April
Output for 5.5.24, 5.5.35 - 5.6.7, 5.6.21, 7.0.6
2016 May 2016 June 2016 July 2016 August 2016 September 2016 October 2016 November 2016 December 2017 January 2017 February 2017 March 2017 April
Output for 5.5.25 - 5.5.29, 5.5.34, 5.6.9 - 5.6.14, 5.6.20, 7.0.5
2016 April 2016 May 2016 June 2016 July 2016 August 2016 September 2016 October 2016 November 2016 December 2017 January 2017 February 2017 March
Output for 5.5.31 - 5.5.33, 5.6.15 - 5.6.19, hhvm-3.12.0, 7.0.0 - 7.0.4
2016 March 2016 April 2016 May 2016 June 2016 July 2016 August 2016 September 2016 October 2016 November 2016 December 2017 January 2017 February
Output for hhvm-3.10.0

Process exited with code 137.
Output for 5.6.8
2016 April 2016 May 2016 June 2016 July 2016 August 2016 September 2016 October 2016 November 2016 December 2017 January 2017 March 2017 April
Output for 5.5.30
2016 March 2016 May 2016 June 2016 July 2016 August 2016 September 2016 October 2016 November 2016 December 2017 January 2017 February 2017 March
Output for 5.4.39 - 5.4.45
2015 September 2015 October 2015 November 2015 December 2016 January 2016 February 2016 March 2016 April 2016 May 2016 June 2016 July 2016 August
Output for 5.4.34 - 5.4.38
2015 March 2015 April 2015 May 2015 June 2015 July 2015 August 2015 September 2015 October 2015 November 2015 December 2016 January 2016 February
Output for 5.3.29, 5.4.28 - 5.4.32
2014 September 2014 October 2014 November 2014 December 2015 January 2015 February 2015 March 2015 April 2015 May 2015 June 2015 July 2015 August
Output for 5.2.0 - 5.2.17
Fatal error: Class 'DateInterval' not found in /in/TvTmE on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/TvTmE 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/TvTmE 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/TvTmE on line 2