diff --git a/library/Zend/Db/Adapter/Pdo/Abstract.php b/library/Zend/Db/Adapter/Pdo/Abstract.php index f199df3998..08957cef7b 100644 --- a/library/Zend/Db/Adapter/Pdo/Abstract.php +++ b/library/Zend/Db/Adapter/Pdo/Abstract.php @@ -54,6 +54,8 @@ abstract class Zend_Db_Adapter_Pdo_Abstract extends Zend_Db_Adapter_Abstract * @see https://github.com/php/php-src/commit/990bb34891c83d12c5129fd781893704f948f2f4 */ public static $isTransactionInBackwardCompatibleMode = true; + public static $isPdoStringifyFetchesBackwardCompatiblePhp8 = true; + /** * PDO type. diff --git a/library/Zend/Db/Adapter/Pdo/Mysql.php b/library/Zend/Db/Adapter/Pdo/Mysql.php index f7b2ba133e..ae3d4f410f 100644 --- a/library/Zend/Db/Adapter/Pdo/Mysql.php +++ b/library/Zend/Db/Adapter/Pdo/Mysql.php @@ -110,7 +110,7 @@ protected function _connect() $this->_config['driver_options'][1002] = $initCommand; // 1002 = PDO::MYSQL_ATTR_INIT_COMMAND } - if (PHP_VERSION_ID >= 80100) { + if (PHP_VERSION_ID >= 80100 && Zend_Db_Adapter_Pdo_Abstract::$isPdoStringifyFetchesBackwardCompatiblePhp8) { // ensure $config['driver_options'] is an array $this->_config['driver_options'] = $this->_config['driver_options'] ?? []; if (!isset($this->_config['driver_options'][PDO::ATTR_STRINGIFY_FETCHES])) {