0

I am receiving the following parse error on line 16: 'syntax error, unexpected T_STRING'. That being said, the following block of codes parses correctly with PHP 5.4.16, however, does not parse correctly with PHP 4.4.9. Thoughts?

To me, the error is suggesting that the interface keyword was not supported in PHP 4.4.9, however, I could not find that in PHP's change log.

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

EDIT (providing full snippet)

<?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');
1
  • Yes, you need PHP 5 for that. Commented Jul 17, 2014 at 16:39

1 Answer 1

3

Please have a look at the New Object Model section of the Migrating from PHP 4 to PHP 5.0.x chapter of the PHP manual. Documentation of the old PHP/4 object model has been moved to the Classes and Objects (PHP 4) appendix.

PHP/5 was released exactly 10 years ago (July 2004) so it's pretty rare to find support for PHP 4 anywhere.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.