sstalle / php7cc

PHP 7 Compatibility Checker
MIT License
1.52k stars 120 forks source link

"yield" usage in expression context possible error #101

Closed skobkin closed 7 years ago

skobkin commented 7 years ago

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 commented 7 years ago

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