|
Posted by Vince Morgan on 04/20/07 20:51
"Steve" <no.one@example.com> wrote in message
news:vq9Wh.1927$lq2.213@newsfe04.lga...
> what's most funny, vince, is that we are arguing complete theory here. php
> does NOT support __set/__get in the way the op thinks it does. i wish it
> did, then all of this talk may do some good...for me anyway.
>
> cheers.
>
>
Perhaps not, but I was building a class a few days ago that was basicaly
like below. The array needs to store about 30 vals so I decided to implement
it similar to below.
class C_Obj
{
private $Obj=array('h'=>10,'i'=>12);
private function getVal($name)
{
return $this->Obj[$name];
}
function &__set($name, $val)
{
$name = $val;
}
function __get($name)
{
return self::getVal($name);
}
}
And it does what I want, as I want it to. Not what some would recomend
perhaps, but I am the one who has to use and maintain it.
Admittedly, I might just get hit by a torpedo tomorrow and my replacement
may not like it much :)
Vince
Navigation:
[Reply to this message]
|