class Test
{
public const TYPE =
[
'READ' => self::TASK_READ,
'ADD' => self::TASK_ADD,
'EDIT' => self::TASK_EDIT,
'FULL' => self::TASK_FULL,
'SHARING' => self::TASK_SHARING
];
public const TASK_READ = 1;
public const TASK_ADD = 2;
public const TASK_EDIT = 4;
public const TASK_FULL = 8;
public const TASK_SHARING = 16;
}
$new = new Test;
$rightType = 'FULL';
echo Test::TYPE[$rightType];