Re: overload extension
| From: | Edin Kadribasic | Date: | Fri, 19 Oct 2001 19:10:28 +0000 |
| Subject: | Re: overload extension | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-68447@lists.php.net to get a copy of this message | ||
> So, has anyone given the overload extension a try? I'm just looking for
> feedback.
I was playing with it and it works as advertised. One question: what is the
meaning of return value in __set()?
Even activating the overload in the constructor seem to work just fine. The
example I tried:
class User
{
var
$db_row=array("username" => "test", "password" =>
"");
function User()
{
overload('User');
}
function __set($name, &$value)
{
$this->db_row[$name]=$value;
return true;
}
function __get($name, &$value)
{
$value=$this->db_row[$name];
return true;
}
}
$u =& new User;
$u -> username="edink";
var_dump($u);