Can a class extend both a class and implement an Interface

前端 未结 3 1263
执念已碎
执念已碎 2021-01-30 06:06

Can a class extend both an interface and another class in PHP?
Basically I want to do this:

interface databaseInterface{
 public function query($q);
 public         


        
3条回答
  •  星月不相逢
    2021-01-30 06:41

    Try it the other way around:

    class database extends mysqli implements databaseInterface { ...}
    

    This should work.

提交回复
热议问题