PHP5 class constants
| From: | Cristiano Duarte | Date: | Sun, 10 Aug 2003 02:27:45 +0000 |
| Subject: | PHP5 class constants | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-159014@lists.php.net to get a copy of this message | ||
This code:
<?
class Priority {
const DEBUG = 0;
const INFO = 1;
const WARN = 2;
const ERROR = 3;
const FATAL = 4;
const MAX_PRIORITY = FATAL;
}
class ExtendedPriority extends Priority {
const REMOTE = Priority::MAX_PRIORITY + 1;
const URGENT = parent::MAX_PRIORITY + 2;
}
?>
results in this error:
PHP Fatal error: Unsupported operand types in /test.php on line 13
Shouldn't class constants support simple expressions ?
Cristiano Duarte