If Iterator::valid() returns false, the foreach() loop will be terminated.
(PHP 5, PHP 7, PHP 8)
Iterator::valid — O anki konum geçerli mi diye bakar
Bu yöntem o anki konumun geçerli olup olmadığını sınamak için Iterator::rewind() ve Iterator::next() yöntemlerinden sonra çağrılır.
Bu işlevin bağımsız değişkeni yoktur.
If Iterator::valid() returns false, the foreach() loop will be terminated.
If your class implements also ArrayAccess interface, you could use as valid() bodyfunction valid(){ return $this->offsetExists($this->position);}