Initialize static members in PHP

Posted by Senthil on Stack Overflow See other posts from Stack Overflow or by Senthil
Published on 2010-05-29T06:39:37Z Indexed on 2010/05/29 6:42 UTC
Read the original article Hit count: 317

Filed under:
|
class Person {
  public static function ShowQualification() {
  }
}

class School {
  public static $Headmaster = new Person(); // NetBeans complains about this line
}

Why is this not possible?

I want to be able to use this like

School::Headmaster::ShowQualification();

..without instantiating any class. How can I do it?

© Stack Overflow or respective owner

Related posts about php

Related posts about static-members