登录  /  注册
要求与PDOStatement::fetchAll(int $mode = PDO::FETCH_DEFAULT, mixed ...$args)兼容
P粉308089080
P粉308089080 2023-12-10 23:55:42
[PHP讨论组]

我们的客户有一个 drupal 网站,但主机强制所有客户端从 PHP 7.4 到 PHP 版本 8,导致 PDO 致命错误导致网站无法加载。

收到错误:

致命错误:声明 DrupalCoreDatabaseStatement::fetchAll(int $mode = PDO::FETCH_DEFAULT,$column_index = null,$constructor_arguments = null) 必须与 PDOStatement::fetchAll(int $mode = 兼容 PDO::FETCH_DEFAULT,混合...$args) /usr/www/users/kdpsipxqzt/core/lib/Drupal/Core/Database/Statement.php 在第 168 行

导致问题的函数:

ERROR (L 168) -> 
public function fetchAll($mode = null, $column_index = NULL, $constructor_arguments = NULL) {
    // Call PDOStatement::fetchAll to fetch all rows.
    // PDOStatement is picky about the number of arguments in some cases so we
    // need to be pass the exact number of arguments we where given.

    switch (func_num_args()) {
      case 0:
        return parent::fetchAll();
      case 1:
        return parent::fetchAll($mode);
      case 2:
        return parent::fetchAll($mode, $column_index);
      case 3:
      default:
        return parent::fetchAll($mode, $column_index, $constructor_arguments);
    }
  }

有人有解决这个问题的想法吗?

我尝试了多种方式进行故障排除,调整函数以更好地匹配 PHP 的 PDOStatement 父函数,但没有成功!

与 PHP 的 PDOStatement 比较:

public function fetchAll($how = null, $className = null, $ctorArgs = null)

我错过了什么吗?

P粉308089080
P粉308089080

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2024 //m.sbmmt.com/ All Rights Reserved | php.cn | 湘ICP备2023035733号