I have a PHP class with a few static properties like so:
static public $_TYPE_DESIGN_DRAFT = 'design_draft';
static public $_TYPE_STORYTELLING_DRAFT = 'storytelling_draft';
static public $_TYPE_OTHER = 'other';
static public $_TYPE_DATA_FILE = 'data_file';
static public $_ALLOWED_EXTENSIONS = array( // on the next line it breaks
self::$_TYPE_DESIGN_DRAFT => array("jpeg", "jpg", "png", "gif", "pdf", "txt", "rtf", "doc", "csv"),
self::$_TYPE_STORYTELLING_DRAFT => array("jpeg", "jpg", "png", "gif", "pdf", "txt", "rtf", "doc", "csv"),
self::$_TYPE_OTHER => array("jpeg", "jpg", "png", "gif", "pdf", "txt", "rtf", "doc", "csv"),
self::$_TYPE_DATA_FILE => array("pdf", "txt", "rtf", "doc", "csv", "xls")
);
But it seems PHP won't let me define an array like that with the value of the keys as static properties of the same class.
A workaround would be to only define the $_ALLOWED_EXTENSIONS var in the constructor of the class, but then I can't make it static because when static, the constructor doesn't get called.
Is there an effective workaround for this?
$_ALLOWED_EXTENSIONS.