|
Posted by ZeldorBlat on 06/15/07 15:23
On Jun 15, 10:30 am, lux <luca.tavole...@gmail.com> wrote:
> Hi,
> It's possible to call a static variable/method from an instance:
>
> Object::my_static_var
>
> I need to do something like this
>
> $obj = new Object(); // (I have dynamic Object type)
>
> $obj::my_static_var
>
> There's any workaround?
>
> Thanks in advance,
> Luca
Just write a getter/setter for it:
class Foo {
public static $bar;
public function getBar() {
return self::$bar;
}
public function setBar($val) {
self::$bar = $val;
}
}
Navigation:
[Reply to this message]
|