xref: /PHP-8.4/ext/pdo_mysql/tests/bug_64705.phpt (revision ac18dd0d)
1--TEST--
2Bug #64705 errorInfo property of PDOException is null when PDO::__construct() fails
3--EXTENSIONS--
4pdo_mysql
5--FILE--
6<?php
7$dsn = 'mysql:host=DonotExistsHost;dbname=test;user=foo;password=wrongpass';
8try {
9  $pdo = new \PDO($dsn, null, null);
10} catch (\PDOException $e) {
11  var_dump(!empty($e->errorInfo) && is_array($e->errorInfo));
12}
13?>
14--EXPECT--
15bool(true)
16