使用斜杠时出现奇怪的错误

时间:2012-05-30 18:10:51

标签: php codeigniter sendgrid

我正在使用Sendgrid的PHP库(https://github.com/sendgrid/sendgrid-php)。按照说明,我不得不使用这行代码:

$mail = new SendGrid\Mail();

我收到错误:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/d/public_html/ac/application/controllers/email.php on line 20

Parse error: syntax error, unexpected T_STRING in /home/d/public_html/ac/application/controllers/email.php on line 20

使用'\'有什么问题吗?对我来说似乎很奇怪......我怎么能让它发挥作用呢?

1 个答案:

答案 0 :(得分:7)

\namespaces的一部分,这是PHP 5.3中的一项新功能。