3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = "2009-01-01"; $b = "2016-02-15"; $i = date("Y", strtotime($a)); $result = array($i); while($i <= date("Y", strtotime($b))){ echo $i."\n"; array_push($result, $i); if(substr($i, 4, 2) == "12"){ $i = (date("Y", strtotime($i."01")) + 1); } else{ $i++; } } print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
2009 2010 2011 2012 2013 2014 2015 2016 Array ( [0] => 2009 [1] => 2009 [2] => 2010 [3] => 2011 [4] => 2012 [5] => 2013 [6] => 2014 [7] => 2015 [8] => 2016 )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
51.12 ms | 401 KiB | 8 Q