Re: [RFC Discuss] Generator Delegation
| From: | Niklas Keller | Date: | Mon, 02 Mar 2015 00:17:42 +0000 |
| Subject: | Re: [RFC Discuss] Generator Delegation | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-84136@lists.php.net to get a copy of this message | ||
2015-03-02 0:52 GMT+01:00 Daniel Lowrey <rdlowrey@php.net>:
> Hi folks,
>
> I'd like to initiate discussion on a proposal to implement generator
> delegation via the following new syntax inside generator functions:
>
> yield * <expr>
>
> The Generator Delegation RFC is available here:
>
> https://wiki.php.net/rfc/generator-delegation
>
> This proposal is conceptually related to (and requires functionality
> proposed by) the forerunning Generator Return Expressions RFC here:
>
> https://wiki.php.net/rfc/generator-return-expressions
>
>
> Thanks for your time,
>
> Daniel
>
The proposed syntax has an issue:
<?php
function a () {
echo yield * 3;
}
$a = a();
$a->send(42);
http://3v4l.org/n1sGb#v550
This is currently valid PHP.
Regards, Niklas