Classes

From: Date: Wed, 09 Apr 2003 14:03:23 +0000
Subject: Classes
Groups: php.general 
Request: Send a blank email to php-general+get-143080@lists.php.net to get a copy of this message
Hi all, why is the output of this code : Hi Hi Thx in advance, R.Brouwer ---------start--------- class a { var $text1; var $text2; function SetText1($text) { $this->$text1 = $text; } function SetText2($text) { $this->$text2 = $text; } } class b extends a { function Test() { $this->SetText2("Hi"); echo $this->$text1 . "<br>"; echo $this->$text2 . "<br>"; } } $a = new b; $a->test(); ---------end--------- Hi Hi

« previous php.general (#143080) next »