3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $datetime1 = new DateTime(); $datetime2 = new DateTime('2008-9-13'); $interval = $datetime2->diff($datetime1); echo $interval->format('%Y.%d'); $newExpDate = $datetime2->format('Y'); for($i=0;$i<$interval->format('%Y.%d');$i++){ echo " ".++$newExpDate; }
Output for 5.6.28, 7.0.14 - 7.1.0
05.12 2009 2010 2011 2012 2013 2014
Output for 5.6.14, 7.0.5 - 7.0.6
07.20 2009 2010 2011 2012 2013 2014 2015 2016
Output for 7.0.4
07.26 2009 2010 2011 2012 2013 2014 2015 2016
Output for 7.0.3
07.5 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.5.27, 5.5.35, 7.0.2
07.9 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.5.24, 5.6.11, 7.0.1
07.10 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.5.26, 7.0.0
07.13 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.3.7 - 5.4.45, hhvm-3.12.0
07.28 2009 2010 2011 2012 2013 2014 2015 2016
Output for hhvm-3.10.0
07.17 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.5.30, 5.6.21
07.19 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.6.20
07.27 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.6.19
07.23 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.6.13, 5.6.18
07.2 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.6.12, 5.6.17
07.6 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.5.25, 5.6.16
07.15 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.6.8, 5.6.15
07.16 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.6.10
07.12 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.6.9
07.14 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.5.34
07.29 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.5.33
07.24 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.5.32
07.4 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.5.31
07.7 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.5.29
07.3 2009 2010 2011 2012 2013 2014 2015 2016
Output for 5.5.28
07.8 2009 2010 2011 2012 2013 2014 2015 2016