Merge branch '2.x' into 3.x

* 2.x:
  Replace strtolower() with strtr() when dealing with method names
This commit is contained in:
Fabien Potencier
2020-01-08 09:32:39 +01:00
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -638,7 +638,7 @@ class ExpressionParser
$stream->expect(/* Token::NAME_TYPE */ 5, null, 'Only variables can be assigned to');
}
$value = $token->getValue();
if (\in_array(strtolower($value), ['true', 'false', 'none', 'null'])) {
if (\in_array(strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), ['true', 'false', 'none', 'null'])) {
throw new SyntaxError(sprintf('You cannot assign a value to "%s".', $value), $token->getLine(), $stream->getSourceContext());
}
$targets[] = new AssignNameExpression($value, $token->getLine());