Classes
[email protected] ("Remco Brouwer")
| Newsgroups | php.doc.nl |
|---|---|
| Message-ID | <[email protected]> |
Hallo, ik heb een vraagje betreft classes.
Waarom geeft de output van deze code :
Hoi
Hoi
---------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("Hoi");
echo $this->$text1 . "<br>";
echo $this->$text2 . "<br>";
}
}
$a = new b;
$a->test();
---------end---------