dear php, about array declaration

So, the following is legal:

$foo = array(
  "bar" => 2*2
);
var_dump($foo);

But this is not:

class Foo {
  public static $foo = array(
    "bar" => 2*2
  );
}
var_dump(Foo::$foo);

I’m sure there is a reasonable explanation for this behavior, but I’m not sure I really want to hear about it.

Comments are closed.