http://www.php.net/manual/en/language.oop5.properties.php Here goes, I quote:
<?php class SimpleClass { // invalid property declarations: public $var1 = 'hello ' . 'world'; public $var2 = <<<EOD hello world EOD; public $var3 = 1+2; public $var4 = self::myStaticMethod(); public $var5 = $myVar;// valid property declarations:
public $var6 = myConstant;
public $var7 = array(true, false);// This is allowed only in PHP 5.3.0 and later.
public $var8 = <<<‘EOD’
hello world
EOD;
}
?>
So any ‘static’ assignment will work but as soon as you call functions or use operators it won’t.
I have said the same thing for a while now. It cannot be done the way you want it!
You’re free to ignore the solution I have given. Say so and I’ll stop bothering you.
If you prefer to rewrite everything every time and prefer to make a change in 27+ different locations, you’re of course free to do that. It’s not the philosophy of Orient Objected programming and it’s not making things easier for yourself (in the long run).
Good luck!