Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以下代码
$t = 1 – (1 - 2);
产量:
Parse error: syntax error, unexpected T_STRING on line 3在 php 5.2.3 和 5.4 中我得到Parse error: in <file> on line 3
Parse error: syntax error, unexpected T_STRING on line 3
Parse error: in <file> on line 3
对我来说,似乎我正在从另一个表达式中减去一个表达式,我认为这是合法的。为什么这是一个解析错误?
第一个“-”是一个破折号,但它应该是一个连字符减号,就像后者一样:“-”。替换它,您的代码将起作用。