oop problems code

From: Date: Fri, 19 Sep 2003 02:22:25 +0000
Subject: oop problems code
Groups: php.general 
Request: Send a blank email to php-general+get-163081@lists.php.net to get a copy of this message
Hello, mailing list, I have problem with this oop code: <? class Person { var $name, $address, $age; function Person($name, $address, $age) {
    $this->name = $name;
    $this->address = $address;
    $this->age = $age;
} } Class Employee extends Person { var $position, $salary; function Employee($name, $address, $age, $position, $salary) {
    $this->Person($name, $address, $age);
    $this->position = $position;
    $this->salary = $salary;
} } Class Displayer extends Employee { function DisplayEmployee() { echo "Name: " . $this->name . "<br>"; echo "Address: " . $this->address . "<br>"; echo "Age: " . $this->age . "<br>"; echo "Position: " . $this->position . "<br>"; echo "Salary: " . $this->salary . "<br>"; } } $obj1 = new Employee("Orlando J Pozo P","Calle 75 AV 9B-10","20","Computer Engineer","$2000"); $obj2 = new Displayer; $obj2->DisplayEmployee(); ?> ---------------------------------------------------------------------------------------------- the output of it is: Warning: Missing argument 1 for employee() in C:\htdocs\ojpp\poo\3\practica\Copy of 18.php on line 16 Warning: Missing argument 2 for employee() in C:\htdocs\ojpp\poo\3\practica\Copy of 18.php on line 16 Warning: Missing argument 3 for employee() in C:\htdocs\ojpp\poo\3\practica\Copy of 18.php on line 16 Warning: Missing argument 4 for employee() in C:\htdocs\ojpp\poo\3\practica\Copy of 18.php on line 16 Warning: Missing argument 5 for employee() in C:\htdocs\ojpp\poo\3\practica\Copy of 18.php on line 16 Name: Address: Age: Position: Salary: ---------------------------------------------------------------------------------------------- I don't know what happen in this code, because, the last inheritance (Displayer Class) that I made, it is inherited the properties and methods of the Employee Class, and as Employee Class is also inherited the functionality of the parent class, the Displayer Class would be inherit this functionality, too. thanks if any could help me, regards, bye.

« previous php.general (#163081) next »