3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $pdts = array(); for($i = ltrim(date('H'), '0'); $i <= ltrim(date('H', time() + 14400), '0') * 2; $i++) { for ($j = 15; $j <= 45; $j += 15) { if ($j > ltrim(date('i'), '0') && ltrim(date('H'), '0') == $i) { $date = date("H.i", strtotime("$i:$j")); $value = $date."h"; $pdts[$value] = $date; } } if (ltrim(date('i'), '0') != 0 && ltrim(date('H'), '0') != $i) { $date = date("H.i", strtotime("$i:00")); $value = $date."h"; $pdts[$value] = $date; } for ($k = 15; $k <= 45; $k += 15) { if (ltrim(date('H'), '0') != $i) { $date = date("H.i", strtotime("$i:$k")); $value = $date . "h"; $pdts[$value] = $date; } } } var_dump(ltrim(date('H', time() + 14400), '0') * 2);
based on 8cYfu
Output for 5.6.0 - 7.3.0alpha1
int(4)