You are here: Re: OT « PHP Programming Language « IT news, forums, messages
Re: OT

Posted by Vince Morgan on 04/20/07 23:43

"Vince Morgan" <vinhar@REMOVEoptusnet.com.au> wrote in message
news:46293f1f$0$16554$afc38c87@news.optusnet.com.au...

Well, I was wrong again apparently.
I can set and get the value of a single private member var as long as the
'name' used in the call is anything _but_ the actualy var name.
The more I play with __get and __set, the weirder things get.
The following code should reproduce the behaviour, it does on my 5.0.3.3
version.
<?
class C_Obj
{
private $h=5;

function __set($name, $val)
{
echo "__set() <br>";
$this->name = $val;
}
function __get($name)
{
echo "__get() <br>";
return $this->name;
}
}

$obj = new C_Obj;
$obj->sdfg=15;
echo $obj->d."<br>";
?>

Clearly I have further misunderstandings, and the more I investigate, the
weirder it gets.
Back to the docs.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация