php Programming Glossary: setengine
Override method parameter with child interface as a new parameter http://stackoverflow.com/questions/19429089/override-method-parameter-with-child-interface-as-a-new-parameter extends Engine function run interface Car function setEngine Engine engine interface WaterCar extends Car function setEngine.. Engine engine interface WaterCar extends Car function setEngine HydroEngine engine It seems it does not break any OOP rules.. it gives me an error Fatal error Declaration of WaterCar setEngine must be compatible with Car setEngine Engine engine php oop..
|