3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo '<div class="list">', PHP_EOL; for ($a = 0; $a <= 10; $a++) { echo ' <div class="product">nazev zbozi</div>', PHP_EOL; if ($a%2 == 1) { echo '</div>', PHP_EOL, '<div class="list">', PHP_EOL; } }
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.30, 7.4.0 - 7.4.23, 8.0.0 - 8.0.10, 8.1rc1 - rc2
<div class="list"> <div class="product">nazev zbozi</div> <div class="product">nazev zbozi</div> </div> <div class="list"> <div class="product">nazev zbozi</div> <div class="product">nazev zbozi</div> </div> <div class="list"> <div class="product">nazev zbozi</div> <div class="product">nazev zbozi</div> </div> <div class="list"> <div class="product">nazev zbozi</div> <div class="product">nazev zbozi</div> </div> <div class="list"> <div class="product">nazev zbozi</div> <div class="product">nazev zbozi</div> </div> <div class="list"> <div class="product">nazev zbozi</div>

preferences:
45.47 ms | 461 KiB | 5 Q