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;
      }     
}


?>

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.