Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<stdClassGenerator::current>
^Predefined Interfaces and ClassesLast updated: Mon, 26 Oct 2026

The Generator class

(PHP 5 >= 5.5.0, PHP 7, PHP 8)

Introduction

Generator objects are returned from generators.

Caution

Generator objects cannot be instantiated via new.

Class synopsis

final class Generator implements Iterator {
/* Methods */
public function current(): mixed
public function getReturn(): mixed
public function key(): mixed
public function next(): void
public function rewind(): void
public function send(mixed $value): mixed
public function throw(Throwable $exception): mixed
public function valid(): bool
public function __wakeup(): void
}

See Also

See also object iteration.

Table of Contents


<stdClassGenerator::current>
^Predefined Interfaces and ClassesLast updated: Mon, 26 Oct 2026