Re: PHP Class Question
| From: | Rasmus Lerdorf | Date: | Mon, 01 Oct 2001 15:45:32 +0000 |
| Subject: | Re: PHP Class Question | ||
| References: | 1 | Groups: | php.lang |
| Request: | Send a blank email to php-lang+get-217@lists.php.net to get a copy of this message | ||
> $class_object = new TempClass();
> $class_object->temp_var = 3;
> echo 'Temp Var = $class_object->temp_var';
echo 'Temp Var = '.$class_object->temp_var;
> class TempClass
> {
> var $temp_var;
>
> function TempFunc()
> {
> global $temp_var;
> $temp_var = 3;
> echo $temp_var;
> }
> }
class TempClass {
var $temp_var;
function TempFunc()
{
$this->temp_var = 3;
echo $this->temp_var;
}
}
-Rasmus