Jump to content

Parse error: syntax error, unexpected T_CONST...


Link

Recommended Posts

I have a class defined as below.  Like six is the first 'const' definition.  Any clue why I am getting this error?  I even tried implementing an interface as you can see from the comments.  I am used to OOP in Java, so I am probably just doing something completely wrong.

 

Thanks in advance!

 

<?php
/*interface MessageConstants {
      const $ERROR = 0;
      const $SUCCESS = 1;
}*/

class Message {//implements MessageConstants {
      var $type;
      var $title;
      var $message;
      const ERROR = 0;
      const SUCCESS = 1;
      
      function message($type, $title, $message) {
            $this->type = $type;
            $this->title = $title;
            $this->message = $message;
      }     
}


?>

Link to comment
Share on other sites

The end of life of php4 has already happened. Except for security patches no new versions of php4 will be released.

 

Everyone should have their schedule in place for upgrading to the latest version of php5.

 

Your web host might already have php5 available. Check with them how to switch or what their schedule is to upgrade.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.