|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-03-23 19:10 UTC] xtpd17 at gmail dot com
Description:
------------
Seems like parser thinks that is a "yield from generator" case, which is not.
Test script:
---------------
<?php
function from1251($a)
{
return $a;
}
function foo()
{
yield from1251('df');
}
// Parse error: syntax error, unexpected '(' in test.php on line 10
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 08:00:02 2025 UTC |
btw, just for the record, you can work around this bug for now with the following: yield (from1251('df')); The extra parenthesis doesn't change the meaning, but it does force the lexer to not consume the "from" portion of the function name.> btw, just for the record, you can work around this bug Yep, thanks, that was the way I fixed it at first almost automatically and calmed down ("well, it's just my migration from 5.6 and new stricter parenthesis rules in 7.1"), but it looked strange enough to dig into it a bit just out of curiosity )).