我安装了 PHP 8.1,但出现了关于已弃用函数的错误。您对此有什么想法并解决它吗?
已弃用:OM\Db::prepare(string $statement, $driver_options = null) 的返回类型应与 PDO::prepare(string $query, array $options = []): PDOStatement|false 或 # 兼容应使用 [\ReturnTypeWillChange] 属性暂时抑制第 114 行 //OM/Db.php 中的通知
114 号线
protected ?array $driver_options = null;
protected ?array $options = null;
public function prepare(string $statement, ?array $driver_options = null) //php8
{
$statement = $this->autoPrefixTables($statement);
$DbStatement = parent::prepare($statement, \is_array($driver_options) ? $driver_options : []);
$DbStatement->setQueryCall('prepare');
$DbStatement->setPDO($this);
return $DbStatement;
}