Bonjour,
Je suis confronté à un problème avec ce code :
Ceci me retourne :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 class Personne { static public function getNom() { echo self::getClass(); } static function getClass() { return 'Personne'; } } class Mogwai extends Personne { static function getClass() { return 'Mogwai'; } } Mogwai::getNom();
... alors que je m'attendais à "Mogwai"...
Code : Sélectionner tout - Visualiser dans une fenêtre à part Personne
Pourquoi un tel comportement ?
Partager