3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $stars=3.24; $average_stars = round($stars*2)/2; for($i=0; $i<floor($average_stars); $i++) { ?> <img src="<?php echo "full"; ?>" /> <?php } if(floor($average_stars)!=$average_stars) {?> <img src="<?php echo "half"; ?>" /> <?php } for($i=5; $i>ceil($average_stars); $i--) { ?> <img src="<?php echo "grey"; ?>" /> <?php }
based on 8X7SH
Output for 4.3.0 - 7.2.0
<img src="full" /> <img src="full" /> <img src="full" /> <img src="grey" /> <img src="grey" />