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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php