We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 78bcc57 commit 2eb1d29Copy full SHA for 2eb1d29
tests/fvt.inc
@@ -39,7 +39,10 @@ abstract class FVTTest
39
public function connect($autoCommit=true, $useLibl=false, $useIsolation=false)
40
{
41
$options = array(PDO::ATTR_AUTOCOMMIT=>$autoCommit);
42
- $this->db = new PDO($this->dsn, $this->user, $this->pass, $options);
+ // Use the driver subclass on PHP 8.4+
43
+ $this->db = version_compare(PHP_VERSION, '8.4.0') >= 0
44
+ ? PDO::construct($this->dsn, $this->user, $this->pass, $options)
45
+ : new PDO($this->dsn, $this->user, $this->pass, $options);
46
$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
47
$this->db->setAttribute(PDO::ATTR_CASE, PDO::CASE_UPPER);
48
$this->db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true);
0 commit comments