class homme
{
var $nom;
var $prenom;
var $age;
function homme()
{
$this->nom = rand(1,100);
$this->prenom= rand(1,100);
$this->age= rand(1,100);
}
}
class joueur extends homme
{
var $defense;
var $milieu;
var $attaque;
function joueur()
{
$this->defense=rand(1,100);
$this->milieu=rand(1,100);
$this->attaque=rand(1,100);
}
function montrerjoueur()
{
echo "$homme->nom|| $this->prenom || $this->age || $this->defense || $this->milieu || $this->attaque <br>";
}
}
To za slucaj da se razlicito zovu funckije, a ako ti se isto zovu funkcije u parent i child klasi a ti hoces iz child klase da zoves onu funkciju iz parent klase, recimo ovako: