Unexpected character in input: '\' (ASCII=92) state=1

My client says he is getting this error using my script:

Warning: Unexpected character in input: '' (ASCII=92) state=1 in /path/to//header.php  on line 34
Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in/path/to/header.php  on line 34

The line 34 in header.php is just use MainClass;

Now, I told him he has to have PHP >= 5.3.0 and he says his PHP version is 5.3.24

What could be the problem?

EDIT: The lines before and after

30. // Define absolute path
31. define("ABSPATH", $abs_path);
32. $_SESSION["abs_path"] = ABSPATH;
33. 
34. use CNSmainCNS;
35. $cns = new CNS();

EDIT 2:

He sent me this:

Program     Version
Apache:     2.2.24
CentOS:     CentOS release 6.4 (Final)
cPanel:     11.36.1 (build 8)
Curl:       7.12.1
MySQL       5.5.30
phpMyAdmin  3.5.5
Python:     2.6.6
Program     Version
Perl:       5.8.8
**PHP:        5.3.24**
ionCube Loader:     4.2.2
Zend Optimizer:     3.3.9
Ruby:       1.8.7
Rails:      3.2.8
OpenSSL:    1.0.0-fips

This happens if you are trying to use namespaces but do not have PHP 5.3. PHP 5.2 and below don't support namespaces and throw this error when they see the backslash.

-- Edit: mixed up the versions. It's 5.2 and below that don't have namespaces, if I'm not mistaken.


Now, I told him he has to have PHP >= 5.3.0 and he says his PHP version is 5.3.24

What could be the problem?

His PHP version is actually < 5.3.0, whether he knows that or not.

See the error occurring on many PHP versions.


如果在提到的错误后出现“意外的T_STRING”错误,则需要安装PHP 5.4+

链接地址: http://www.djcxy.com/p/11928.html

上一篇: 解析错误:语法错误,意外的T

下一篇: 输入中意外的字符:'\'(ASCII = 92)状态= 1