Fatal error: Declaration of .. must be compatible with .. PHP

后端 未结 4 1650
無奈伤痛
無奈伤痛 2020-12-10 01:54

I\'m getting the following error:

Fatal error: Declaration of Shoppingcart::addToCart() must be compatible with that of Ishoppingcart::addToCart() in klassen         


        
4条回答
  •  温柔的废话
    2020-12-10 02:26

    Interface Ishoppingcart seems to define addToShoppingCart without parameters, but class Shoppingcart defines the same function taking Product as a parameter. I suppose the method in the interface should take Product as a parameter as well.

提交回复
热议问题