How do you access static variables from statically called functions.
IE how do i fill in the dots.

class myClass{
static $sv = 1;

function myFunc(){
    printf( "sv = %s<BR>", .......sv );
}

}

myClass::myFunc();
myClass::myFunc();

I know that $this is not accepted in static functions and myClass::sv doesn't work either. Is it possible at all? have
I misunderstood some oo principal? any advice would be welcome.

    class myClass{ 
      static $sv = 1; 
      function myFunc(){ 
        printf( "sv = %s<BR>", self::$sv ); 
      } 
    } 
    myClass::myFunc(); 
    

      Thanks guys, I guess I just missed the $ in myClass::$sv

        Write a Reply...