I am working on an OOP implementation and I have the following:
abstract class Parent{
public abstract function select($order="desc");
}
class Child extends Parent{
public function select($order) // here is the problem error
{
// selection code
}
}
This throws an error that tells me the declaration must be compatible with the parent method.
I did implement it with the right parameters except I didn't carry over the default parameter setting.
I do not want to copy past the same prototype of parent method in 100 classes if i want someday change the default value. How can I do this?
does generic exist in php ??