3v4l.org

run code in 300+ PHP versions simultaneously
<?php $review=(object)['rate'=>30]; for($i=0; $i<5; ++$i){ echo '<i class="fa fa-star',($review->rate<=$i?'-o':''),'" aria-hidden="true"></i>'; echo "\n"; }
Output for 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 8.0.0 - 8.0.12, 8.1rc1 - rc3
<i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i>

preferences:
22.27 ms | 460 KiB | 5 Q