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