Creating a class with variables like this works fine:
class Example {
public static $example = array('simple', 'example');
// ...
}
But, if I use a function, when defining the variable, I get an unexpected '(', expecting ')' error:
class Example {
public static $example = explode(' ', 'simple example');
// ...
}
I tried it without the static keyword and still got the same error. Is it possible to use functions, when defining class variables like that? What is the alternative?