I have an abstract class using this method:
abstract class X { abstract public function method( $param ); }
In the implementation, I do:
class Y extends X { public function method( ClassName1 $param ) { ... } } class W extends X { public function method( ClassName2 $param ) { ... } }
I need to put ClassName1 and ClassName2 in both methods, but I get this error:
The declaration of Y::method() must be compatible with X::method($param) in ...
What do I need to declare an abstract method in class X to solve the problem? Perhaps the real question arises: what should be the class name in X::method( _____ $param ) to solve the problem?
Thanks.
source share