class My_class
{
const STATUS_ERROR = 0;
const STATUS_OK = 1;
const DB_TABLE = TABLE_PREFIX. 'class_table';
} The two states of consts work fine and can be accessed in class methods, because self::STATUS_ERROR and self::STATUS_OK just fine.
The problem is how to stop the next error that occurs when trying to determine the third constant.
Parse error: syntax error, unexpected '.', expecting ',' or ';' in /home/sub/sub/directory/script.php
oop php class const constants
Matthew
source share