3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime('2000-12-01'); for($i = 0; $i < 200; $i++) { $date->add(new DateInterval('P1M')); echo $date->format('d.m.Y') . PHP_EOL; }
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
01.01.2001 01.02.2001 01.03.2001 01.04.2001 01.05.2001 01.06.2001 01.07.2001 01.08.2001 01.09.2001 01.10.2001 01.11.2001 01.12.2001 01.01.2002 01.02.2002 01.03.2002 01.04.2002 01.05.2002 01.06.2002 01.07.2002 01.08.2002 01.09.2002 01.10.2002 01.11.2002 01.12.2002 01.01.2003 01.02.2003 01.03.2003 01.04.2003 01.05.2003 01.06.2003 01.07.2003 01.08.2003 01.09.2003 01.10.2003 01.11.2003 01.12.2003 01.01.2004 01.02.2004 01.03.2004 01.04.2004 01.05.2004 01.06.2004 01.07.2004 01.08.2004 01.09.2004 01.10.2004 01.11.2004 01.12.2004 01.01.2005 01.02.2005 01.03.2005 01.04.2005 01.05.2005 01.06.2005 01.07.2005 01.08.2005 01.09.2005 01.10.2005 01.11.2005 01.12.2005 01.01.2006 01.02.2006 01.03.2006 01.04.2006 01.05.2006 01.06.2006 01.07.2006 01.08.2006 01.09.2006 01.10.2006 01.11.2006 01.12.2006 01.01.2007 01.02.2007 01.03.2007 01.04.2007 01.05.2007 01.06.2007 01.07.2007 01.08.2007 01.09.2007 01.10.2007 01.11.2007 01.12.2007 01.01.2008 01.02.2008 01.03.2008 01.04.2008 01.05.2008 01.06.2008 01.07.2008 01.08.2008 01.09.2008 01.10.2008 01.11.2008 01.12.2008 01.01.2009 01.02.2009 01.03.2009 01.04.2009 01.05.2009 01.06.2009 01.07.2009 01.08.2009 01.09.2009 01.10.2009 01.11.2009 01.12.2009 01.01.2010 01.02.2010 01.03.2010 01.04.2010 01.05.2010 01.06.2010 01.07.2010 01.08.2010 01.09.2010 01.10.2010 01.11.2010 01.12.2010 01.01.2011 01.02.2011 01.03.2011 01.04.2011 01.05.2011 01.06.2011 01.07.2011 01.08.2011 01.09.2011 01.10.2011 01.11.2011 01.12.2011 01.01.2012 01.02.2012 01.03.2012 01.04.2012 01.05.2012 01.06.2012 01.07.2012 01.08.2012 01.09.2012 01.10.2012 01.11.2012 01.12.2012 01.01.2013 01.02.2013 01.03.2013 01.04.2013 01.05.2013 01.06.2013 01.07.2013 01.08.2013 01.09.2013 01.10.2013 01.11.2013 01.12.2013 01.01.2014 01.02.2014 01.03.2014 01.04.2014 01.05.2014 01.06.2014 01.07.2014 01.08.2014 01.09.2014 01.10.2014 01.11.2014 01.12.2014 01.01.2015 01.02.2015 01.03.2015 01.04.2015 01.05.2015 01.06.2015 01.07.2015 01.08.2015 01.09.2015 01.10.2015 01.11.2015 01.12.2015 01.01.2016 01.02.2016 01.03.2016 01.04.2016 01.05.2016 01.06.2016 01.07.2016 01.08.2016 01.09.2016 01.10.2016 01.11.2016 01.12.2016 01.01.2017 01.02.2017 01.03.2017 01.04.2017 01.05.2017 01.06.2017 01.07.2017 01.08.2017
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::add() in /in/aIYQl on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/aIYQl on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/aIYQl on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/aIYQl on line 3

preferences:
306.59 ms | 401 KiB | 355 Q