dziś spotkałem się z błędem o treści:
Declaration of sf_orm::select() should be compatible with that of sf_db::select()
budowa klas wygląda mniej więcej tak:
class db{ protected $sql; protected $sql_args; protected $query; //self:b[]
//$this->sql=''; ///itd itp... return $this; } } class db2 extends db{ //nic lub coś innego ... } }
I błąd powstaje,
jednak przy takiej budowie już nie:
class x { protected $z; public function connect(){ self::$x=555; } public function select(){ $this->z=11; return $this; } public function id(){ } } class y extends x{ public function select($x=5){ return parent::select(); } } $x=new x; $x->connect(); $z=new y; $c=$z->select()->id();
Co dokładnie powoduje ten błąd?
Jakieś propozycje jak rozwiązać tez problem?