Class Static Properties

 
    <?phpclass StaticExample {
    static public $aNum = 0;
    static public function sayHello() {
        self::$aNum++;
        print "hello (".self::$aNum.")\n";
    }
}StaticExample::sayHello();
StaticExample::sayHello();
StaticExample::sayHello();?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.