【发布时间】:2014-09-08 15:36:18
【问题描述】:
我在第 16 行收到以下解析错误:“语法错误,意外的 T_STRING”。话虽如此,下面的代码块在 PHP 5.4.16 中可以正确解析,但是在 PHP 4.4.9 中无法正确解析。想法?
对我来说,错误提示 PHP 4.4.9 不支持 interface 关键字,但是,我在 PHP 的更改日志中找不到。
interface iA { // line 16
public function methodA();
public function methodB();
public function methodC();
}
编辑(提供完整的 sn-p)
<?php
// a comment.
// a comment.
// a comment.
// a comment.
// a comment.
// a comment.
// a comment.
if (!defined('PRODUCT_ENV')) {
exit;
}
// a comment.
interface iA {
public function methodA();
public function methodB();
public function methodC();
}
include(PRODUCT_PWD . PRODUCT_IMPLES . 'anotherfile.php');
【问题讨论】:
-
是的,你需要 PHP 5。
标签: php parsing parse-error php-parse-error