Unfortunately, you cannot set class variables by default using expressions. You can use only primitive types and values. Only array()recognized.
, " ", ... :
<?php
class Test
{
public static $blah;
private static $__initialized = false;
public static function __initStatic() {
if(self::$__initialized) return;
self::$blah = (1 == 1) ? 'this' : 'or this';
self::$__initialized = true;
}
}
Test::__initStatic();
:
<?php
echo Test::$blah;
Test::$blah , Test::__initStatic().