cannot be 0

Description

The third argument of range() is the step: the amount to progress for each element, compared to the previous one. When that step is null, the range() function always creates the same element, with no chance to finish. This cannot be 0.

Example

<?php

$interval = range(10, 20, 0);

?>

Solutions

  • Use a value strictly non-zero.