How do I get a PHP class constructor to call its parent's parent's constructor?

前端 未结 15 1396
滥情空心
滥情空心 2020-11-28 21:38

I need to have a class constructor in PHP call its parent\'s parent\'s (grandparent?) constructor without calling the parent constructor.

//         


        
15条回答
  •  抹茶落季
    2020-11-28 21:52

    Beautiful solution using Reflection.

    invoke($this);
        }
    }
    
    $kiddo = new Kiddo();
    $papa = new Papa();
    

提交回复
热议问题