PHP Strict Standards: Declaration of should be compatible

前端 未结 4 1323
Happy的楠姐
Happy的楠姐 2021-02-19 12:47

I have the following hierarchy of classes:

class O_Base {...}

class O extends O_Base {...}

abstract class A_Abstract {
    public function save(O_Base $obj) {         


        
4条回答
  •  不要未来只要你来
    2021-02-19 13:51

    Do you see the difference of the function signatures?

    // A_Abstract
    public function save(O_Base $obj) {...}
    
    // A
    public function save(O $obj) {
    

    They are not compatible.

提交回复
热议问题