note 71749 deleted from language.oop5.basic by felipe
| From: | felipe@php.net | Date: | Mon, 24 Mar 2008 22:12:59 +0000 |
| Subject: | note 71749 deleted from language.oop5.basic by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-137473@lists.php.net to get a copy of this message | ||
Note Submitter: Andrew V Azarov
----
Remember that $this->var and $this->$var are different
when using smth like
<?
class test
{
var $var;
function Setvar()
{
$this->$var = "test";
}
}
$m = new test();
$m->Setvar();
$m->var;
?>
will result in an fatal error or empty var
do instead
<?
$this->var = "test";
?>
then u may access it like <? $m->var; ?>