Possible Duplicate:
Initializing PHP class property declarations with simple expressions yields syntax error
Is it possible to achieve the following in PHP 5.2.17
?
$basePath = '/final';
class Foo {
public $data = $basePath . '/data';
}
The default values for properties must be constant in the source, e.g. strings and array literals. No expressions.
Use the __construct()
method for anything more complicated.