#49320 [Opn]: PDO returns null when SQLite connection fails

From: Date: Fri, 21 Aug 2009 14:16:09 +0000
Subject: #49320 [Opn]: PDO returns null when SQLite connection fails
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-141362@lists.php.net to get a copy of this message
ID: 49320 User updated by: brandon at brandonsavage dot net Reported By: brandon at brandonsavage dot net Status: Open Bug Type: PDO related Operating System: All PHP Version: 5.2.10 New Comment: The version is mentioned as 5.2.10 but i tested this in 5.3.0 and it exists there as well. Previous Comments: ------------------------------------------------------------------------ [2009-08-21 13:45:15] brandon at brandonsavage dot net Description: ------------ The PDO extension should either return an object or throw an exception. However, with PDO and the SQLite driver, this does not happen. Reproduce code: --------------- <?php //Use the wrong driver so the connection fails $pdo = new PDO('sqlite2:bookstore.db'); var_dump($pdo); Expected result: ---------------- PDOException Actual result: -------------- null ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49320&edit=1

« previous php.bugs (#141362) next »