[PECL-CVS] [pecl-database-pdo_ibm] pdo-class-8.5: Test driver subclasses on 8.4+

[email protected] (Calvin Buckley)
Newsgroups php.pecl.cvs
Message-ID <[email protected]>
Author: Calvin Buckley (NattyNarwhal)
Date: 2025-09-19T14:36:50-03:00

Commit: https://github.com/php/pecl-database-pdo_ibm/commit/2eb1d29dd9820318b35b946fa3fe5fbacb89b7a9
Raw diff: https://github.com/php/pecl-database-pdo_ibm/commit/2eb1d29dd9820318b35b946fa3fe5fbacb89b7a9.diff

Test driver subclasses on 8.4+

Changed paths:
  M  tests/fvt.inc


Diff:

diff --git a/tests/fvt.inc b/tests/fvt.inc
index c34d62c..8b19968 100644
--- a/tests/fvt.inc
+++ b/tests/fvt.inc
@@ -39,7 +39,10 @@ abstract class FVTTest
 	public function connect($autoCommit=true, $useLibl=false, $useIsolation=false)
 	{
 		$options = array(PDO::ATTR_AUTOCOMMIT=>$autoCommit);
-		$this->db = new PDO($this->dsn, $this->user, $this->pass, $options);
+		// Use the driver subclass on PHP 8.4+
+		$this->db = version_compare(PHP_VERSION, '8.4.0') >= 0
+			? PDO::construct($this->dsn, $this->user, $this->pass, $options)
+			: new PDO($this->dsn, $this->user, $this->pass, $options);
 		$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
 		$this->db->setAttribute(PDO::ATTR_CASE, PDO::CASE_UPPER);
 		$this->db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.