使用作曲家自动加载时,会发生错误。 PHP 7.4

问题描述 投票:-2回答:1

错误:syntax error, unexpected '{', expecting identifier (T_STRING) or function (T_FUNCTION) or const (T_CONST) or \\ (T_NS_SEPARATOR)

此错误在自动加载错误类时发生。为什么?

php composer-php php-7 autoload
1个回答
0
投票

当您使用use {Something, AnotherThing}语法而不是这样做时会发生这种情况>

use Something;
use AnotherThing;

这仅影响自动加载的类文件。您可以在“命令式” php文件中自由使用简短语法。

© www.soinside.com 2019 - 2024. All rights reserved.