Correct attempt:
<?php
class TestClass {
private static $VAR = null;
private static function doSomething($input) {
return null;
}
public static function Construct(){
self::$VAR = self::doSomething(array());
}
}
TestClass::Construct();
?>
You CAN initialize a static to a scalar and an array. You CAN NOT initialize it with a function call. So you need a public method that can be invoked to initialize statics if you need things to be private.
If they were public, you could have done:
TestClass::$VAR = TestClass::doSomething(array());
right after the class declaration or when you want to instantiate it.
PROOF
Like any other PHP static variable, static properties may only be initialized using a literal or constant; expressions are not allowed. So while you may initialize a static property to an integer or array (for instance), you may not initialize it to another variable, to a function return value, or to an object. from PHP.net/Static