3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $startYear = 2014; $startQuarter = 4; $endYear = date('Y'); $endQuarter = floor((date('m')-1) / 3) + 1; for($year = $startYear; $year <= $endYear; $year++) { for($quarter = $startQuarter; $quarter <= $endQuarter; $quarter++) { echo '<option value="' . $year . ' / ' . $quarter . ((($interval == $year . ' / ' . $quarter) || (!$interval && $quarter == $endQuarter && $year == $endYear)) ? ' selected="selected"' : '') . '">' . $year . ' / ' . $quarter . '</option>'; } }
Output for 4.3.0 - 7.2.0