Napisałem taki kod o Butelkach piwa w PHP 5.6. Czy można go jakoś poprawić, ulepszyć czy upiększyć w standardzie języka PHP 7.3 - 7.4?
<?php
$plural = 's';
foreach (range(99, 1) as $i) {
echo "$i bottle$plural of beer on the wall,<br>";
echo "$i bottle$plural of beer!<br>";
echo "Take one down, pass it around!<br><br>";
if ($i - 1 == 1){
$plural = '';
}
if ($i > 1){
echo ($i - 1) . " bottle$plural of beer on the wall!<br>";
}else{
echo "No more bottles of beer on the wall!<br>";
}
}