3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $quarters = array(15, 30, 45, 60); $diff = 15; foreach($quarters as $quarter){ $curMinutes = date('i'); if(strlen($curMinutes) == 2) ? (int) $curMinutes[1] : (int) $curMinutes; $curDiff = $quarter - date('i'); if($curDiff < $diff && $curDiff > 0){ $diff = $curDiff; } } $dt = new DateTime; $dt->add(new DateInterval('PT'.$diff.'M')); echo $dt->format('Y-m-d H:i:00');
Output for 5.3.0 - 5.4.28
Parse error: syntax error, unexpected '?' in /in/jaSEc on line 7
Process exited with code 255.