3111:37:32 Programmation Web 2012-2013 Typage des paramètres class Entier { public $v ; public $v ; public function __construct($_v) { public function __construct($_v) { $this->v = $_v ; } $this->v = $_v ; } public function egal(self $a) { public function egal(self $a) { return intval($this->v == $a->v) ; } return intval($this->v == $a->v) ; }} $E1 = new Entier(10) ; $E2 = new Entier(20) ; echo $E1->egal($E2) ; echo $E1->egal(12) ; 0 Argument 1 passed to Entier::egal() must be an instance of Entier, integer given, …
{}