note 56224 rejected from language.oop5 by mazzanet
| From: | mazzanet@php.net | Date: | Sat, 27 Aug 2005 21:44:24 +0000 |
| Subject: | note 56224 rejected from language.oop5 by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-94275@lists.php.net to get a copy of this message | ||
Note Submitter: madcoder_jm at hotmail dot com
----
I'm a newbie to php but i have some c++ programming experience so i'm okay with classes.
I'm trying to get a class to instantiate and use echo to output the value of the class members,
however the browser always outputs a blank page.
Here's the code:
class Human{
private $arms;
private $legs;
private $eyes;
public function setArms($num)
{
if($num<=2 && $num>0)$this->arms=$num;
}
public function setLegs($num){
if($num<=2 && $num>0)$this->legs=$num;
}
public function setEyes($num)
{
if($num<=2 && $num>0)$this->eyes=$num;
}
public function getArms()
{
$this->arms;
}
public function getLegs(){
return $this->legs;
}
public function getEyes()
{
return this->eyes;
}
public function _construct()
{
$this->eyes=2;
$this->arms=2;
$this->legs=2;
}
}//End of class
Can anyone help?!!!!