PHP: “Declaration of … should be compatible with that of …”

前端 未结 2 1855
温柔的废话
温柔的废话 2021-01-06 07:13

I\'d like to create an interface for entities that are CRUDable (can be saved and deleted). Here is my abstract class:

abstract class AbstractCrudableEntity          


        
2条回答
  •  忘掉有多难
    2021-01-06 07:31

    Overriding constructors is a special case:

    Unlike with other methods, PHP will not generate an E_STRICT level error message when __construct() is overridden with different parameters than the parent __construct() method has.

    You can not do that with other methods.

提交回复
热议问题