php类中常量的定义
先看下面一段代码:
class SVN { const DEFAULT_PATH = "/tmp"; const SVNLOOK_CMD = "/usr/bin/svnlook"; const REVISION_DIR = dirname(__FILE__).'/revisions'; const REVISION_DIR_ZIP = dirname(__FILE__).'/zips';
提示
PHP Parse error: syntax error, unexpected '(', expecting ',' or ';' in /app/code/script/svn_hooks/handle.php on line 6
原来表达式不能出现在常量里;