Re: Syntax problem - dynamic static member access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jake, as you probably already know you usually have to give the class name when attempting to get a static variable, i.e.

YourClassName::$bob;

You *can* dynamically refer to a static class variable from within an object without knowing the name of the class; this is what self is for. i.e.

class YourClassName {
  function getStatic($var) {
    return self::$var;
  }
}

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux