3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $hour = date('H'); $day = date('w'); $shows = array( "", "Show 1", "Show 2", "Show 3", "Show 4", ); $show = 0; if($hour >= 18 && $hour < 21 && $day == 5) { $show = 1; } if($hour >= 21 && $hour < 22 && $day == 5) { $show = 2; } if($hour >= 22 && $hour < 24 && $day == 5) { $show = 3; } if($hour >= 0 && $hour < 6 && $day == 6) { $show = 4; } for($i = 0; $i < count($shows); $i++){ if($show == $i) { echo '<span style="font-weight:bold;">'.$shows[$i].'</span>'; } else { echo '<span>'.$shows[$i].'</span>'; } echo "<br>"; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<span style="font-weight:bold;"></span><br><span>Show 1</span><br><span>Show 2</span><br><span>Show 3</span><br><span>Show 4</span><br>