Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"yield" usage in expression context possible error #101

Closed
skobkin opened this issue Feb 9, 2017 · 1 comment
Closed

"yield" usage in expression context possible error #101

skobkin opened this issue Feb 9, 2017 · 1 comment

Comments

@skobkin
Copy link

skobkin commented Feb 9, 2017

For this code:

$requests = function () use ($client, $urls, &$tempFiles) {
    // ...
    foreach ($urls as $url) {
        // ...
        yield $url => function ($poolOptions) use ($client, $url, $tmpFileName) {
            // ...
            return $client->getAsync($url, $requestOptions);
        };
    }
};

php7cc returns:

> Line 87: "yield" usage in expression context
    function () use($client, $urls, &$tempFiles) {
    };

Seems like there is no possible different behavior error in this code. Am I wrong?

@sstalle
Copy link
Owner

sstalle commented Feb 9, 2017

@skobkin I think you are right. This must be a bug in php7cc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants