# Generator::

- Thread: https://externals.io/message/101980
- Original archive: https://news-web.php.net/php.internals/101980
- Started by Christoph M. Becker on 2018-03-16T15:44:40+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #101980 — Christoph M. Becker — 2018-03-16T15:44:40+00:00

URL: https://externals.io/message/101980#101980

Hi everybody!

Wrt. <https://bugs.php.net/76104> I wonder whether the behavior has
actually been deliberately designed this way (i.e. whether it is indeed
a documentation issue).

Consider the following variation of the Generator::send() example:
<https://3v4l.org/vbbZM>.  I certainly would not expect `NULL` as fourth
line of the output, but rather `int(1)`.

Can somebody please clarify?

-- 
Christoph M. Becker

---

## #101981 — Nikita Popov — 2018-03-16T16:00:41+00:00

URL: https://externals.io/message/101980#101981 · In reply to: #101980

On Fri, Mar 16, 2018 at 4:44 PM, Christoph M. Becker <cmbecker69@gmx.de>
wrote:

> Hi everybody!
>
> Wrt. <https://bugs.php.net/76104> I wonder whether the behavior has
> actually been deliberately designed this way (i.e. whether it is indeed
> a documentation issue).
>
> Consider the following variation of the Generator::send() example:
> <https://3v4l.org/vbbZM>.  I certainly would not expect `NULL` as fourth
> line of the output, but rather `int(1)`.
>
> Can somebody please clarify?
>

Yes, this is working as intended. `next()` is equivalent to send(null),
modulo the return value.

Nikita

---

## #101982 — Christoph M. Becker — 2018-03-16T16:22:17+00:00

URL: https://externals.io/message/101980#101982 · In reply to: #101981

> On Fri, Mar 16, 2018 at 4:44 PM, Christoph M. Becker <cmbecker69@gmx.de>
> wrote:
> 
> > […]
> 
> Yes, this is working as intended. `next()` is equivalent to send(null),
> modulo the return value.

Ah, now I see!  Thanks!

-- 
Christoph M. Becker
