PHP Duff's device

Duffs device is implimentation of loop unrolling. You can speed up the script execution by running the loop N/n times but run in the loop (unrolling) the same command multiple times.

<?php
$iterations = 16;
$val = 0;
$n = $iterations / 8;

while ($n--)
{
  $val++;
  $val++;
  $val++;
  $val++;
  $val++;
  $val++;
  $val++;
  $val++;
}