类定义中的PHP字符串连接

Nik*_*s R 1 php string class concatenation php-5.2

可能重复:
使用简单表达式初始化PHP类属性声明会产生语法错误

是否有可能实现以下目标PHP 5.2.17

$basePath = '/final';

class Foo {
    public $data = $basePath . '/data';
}
Run Code Online (Sandbox Code Playgroud)

ale*_*lex 5

属性的默认值在源中必须是常量,例如字符串和数组文字.没有表达.

使用该__construct()方法更复杂.