0

I'm trying to name my controller 'New' in codeigniter but get the following error

Parse error: syntax error, unexpected T_NEW, expecting T_STRING in
C:\site\application\controllers\new.php on line 3

(although New doesn't seem to be reserved according to CI user guide - > https://www.codeigniter.com/user_guide/general/reserved_names.html)

Any workaround would be appreciated. tx!

4

1 回答 1

0

new是 php 中的保留关键字。您不能将其用作类名。

请参阅保留关键字列表。

可能的重复问题为什么我在 PHP 中收到意外的 T_NEW 错误?

于 2013-03-31T09:13:56.420 回答