0

我在第 16 行收到以下解析错误:“语法错误,意外的 T_STRING”。话虽如此,下面的代码块在 PHP 5.4.16 中可以正确解析,但是在 PHP 4.4.9 中无法正确解析。想法?

对我来说,该错误表明interfacePHP 4.4.9 不支持该关键字,但是,我在 PHP 的更改日志中找不到该关键字。

interface iA { // line 16
  public function methodA();
  public function methodB();
  public function methodC();
}

编辑(提供完整的片段)

<?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');
4

1 回答 1

3

请查看PHP 手册的从 PHP 4 迁移到 PHP 5.0.x章节的新对象模型部分。旧 PHP/4 对象模型的文档已移至类和对象 (PHP 4)附录。

PHP/5 是在 10 年前(2004 年 7 月)发布的,因此很难在任何地方找到对 PHP 4 的支持。

于 2014-07-17T16:45:18.857 回答