< PHP OOP
PHP OOP interfész
Interfész
interface ElolenyTevekenyseg {
public function mozog();
}
class Allat implements ElolenyTevekenyseg {
public function eszik() {
echo "Eszek...";
}
public function hang() {
echo "auuuuu";
}
}
Kiterjesztett interfész
interface ElolenyTevekenyseg {
public function mozog();
}
interface AllatTevekenyseg extends ElolenyTevekenyseg {
public function eszik();
public function hang();
}
class Allat implements AllatTevekenyseg {
public function mozog() {
echo "Mozgok...";
}
public function eszik() {
echo "Eszek...";
}
public function hang() {
echo "auuuuu";
}
}