diff --git a/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php b/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php index 7ebfb4ecbdb..cc93a9b7e42 100644 --- a/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php +++ b/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php @@ -45,7 +45,7 @@ public function connect(array $params, $username = null, $password = null, array $driverOptions ); - if (PHP_VERSION_ID >= 50600 + if (defined('PDO::PGSQL_ATTR_DISABLE_PREPARES') && (! isset($driverOptions[PDO::PGSQL_ATTR_DISABLE_PREPARES]) || true === $driverOptions[PDO::PGSQL_ATTR_DISABLE_PREPARES] ) diff --git a/tests/Doctrine/Tests/DBAL/Driver/PDOPgSql/DriverTest.php b/tests/Doctrine/Tests/DBAL/Driver/PDOPgSql/DriverTest.php index 36d221765a7..495f690482b 100644 --- a/tests/Doctrine/Tests/DBAL/Driver/PDOPgSql/DriverTest.php +++ b/tests/Doctrine/Tests/DBAL/Driver/PDOPgSql/DriverTest.php @@ -107,7 +107,7 @@ protected function createDriver() */ private function skipWhenNotUsingPhp56AndPdoPgsql() { - if (PHP_VERSION_ID < 50600) { + if (! defined('PDO::PGSQL_ATTR_DISABLE_PREPARES')) { $this->markTestSkipped('Test requires PHP 5.6+'); }