next) { if ($slow === $fast) { return true; } $slow = $slow->next; $fast = $fast->next->next; } return false; } }