3v4l.org

run code in 300+ PHP versions simultaneously
<?php $starNumber = 3.5; $output =""; for($x=1;$x<=$starNumber;$x++) { $output .= '<i class="fa fa-star" aria-hidden="true"></i>' . "\n"; } if (strpos($starNumber,'.')) { $output .= '<i class="fa fa-star-half-o" aria-hidden="true"></i>' . "\n"; $x++; } while ($x<=5) { $output .= '<i class="fa fa-star-o" aria-hidden="true"></i>' . "\n"; $x++; } Echo $output;

preferences:
159.95 ms | 404 KiB | 5 Q