PHP 8.5.0 Beta 1 available for testing

Voting

: one minus zero?
(Example: nine)

The Note You're Voting On

Sjakie Pruts
6 years ago
The return type is merely documented here, it's not actually enforced. For instance, the IteratorIterator implementation can return Traversable, which would break the interface. Most likely, this is for backwards compatibility with code written before return type hints existed. It's still possible to create your own namespaced OuterIterator interface that extends the global one and add a typehint for this method in there.

<< Back to user notes page

To Top