Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Class static properties

Sun Oct 26, 2008 11:30 pm

Code:
<?php

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

StaticExample::sayHello();
StaticExample::sayHello();
StaticExample::sayHello();

?>




Post a reply
  Related Posts  to : Class static properties
 difference between a static and a non-static inner class     -  
 Define boolean Class properties     -  
 links CSS properties     -  
 Static Import     -  
 What is a static method     -  
 Change the properties of div tag     -  
 static vs fixed div position     -  
 Static Methods and Variables     -  
 Java properties utility     -  
 Change CSS Properties from JQuery     -  

Topic Tags

PHP OOP