Bonjour,

Je suis confronté à un problème avec ce code :

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();
Ceci me retourne :

... alors que je m'attendais à "Mogwai"...

Pourquoi un tel comportement ?