Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
  Fix failing PDO PgSQL test
This commit is contained in:
Nikita Popov 2021-10-07 20:11:53 +02:00
commit 90ceac6f7c

View file

@ -47,7 +47,7 @@ else
# Expected to fail; unless told otherwise, PDO assumes string inputs
# false -> "" as string, which pgsql doesn't like
if (!$res->execute(array(false)))
print_r($res->errorInfo());
print_r(normalizeErrorInfo($res->errorInfo()));
else
print_r($res->fetchAll(PDO::FETCH_ASSOC));
@ -83,13 +83,17 @@ else
# Expected to fail; unless told otherwise, PDO assumes string inputs
# false -> "" as string, which pgsql doesn't like
if (!$res->execute(array(false))) {
$err = $res->errorInfo();
// Strip additional lines outputted by recent PgSQL versions
$err[2] = trim(current(explode("\n", $err[2])));
print_r($err);
print_r(normalizeErrorInfo($res->errorInfo()));
} else {
print_r($res->fetchAll(PDO::FETCH_ASSOC));
}
function normalizeErrorInfo(array $err): array {
// Strip additional lines outputted by recent PgSQL versions
$err[2] = trim(current(explode("\n", $err[2])));
return $err;
}
?>
--EXPECTF--
Array