这是我的代码示例。
class SomeClass extends SomeOtherClass
{
function __construct($input)
{
parent::__construct($input);
$this->conn = new mysqli('a','b','c','d');
}
function getConnection()
{
return &$this->conn;
}
}
我的主要目标是我想通过引用它而不是创建另一个 MySQLi 类来返回 MySQLi 连接。