PHP: if($this->spins < 1) this will never run, because $this->spins is never below 1, please move this line above $this->spins++;