|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #72653 SQLite should allow opening with empty filename
Submitted: 2016-07-22 19:36 UTC Modified: 2016-07-27 17:16 UTC
From: nazar at mokrynskyi dot com Assigned: cmb (profile)
Status: Closed Package: SQLite related
PHP Version: 7.0.9 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: nazar at mokrynskyi dot com
New email:
PHP Version: OS:


 [2016-07-22 19:36 UTC] nazar at mokrynskyi dot com
SQLite allows to open database with empty filename (

> If the filename is an empty string, then a private, temporary on-disk database will be created. This private database will be automatically deleted as soon as the database connection is closed.

This is also true for HHVM implementation:

Would be nice to be consistent and add support for this in PHP as well (especially, since underlying interface already have it).

P.S. doesn't seem to be relevant here anymore

Test script:
new SQLite3('');

Expected result:
No output

Actual result:
PHP Fatal error:  Uncaught Exception: Unable to expand filepath in %s:2
Stack trace:
#0 %s(2): SQLite3->__construct('')
#1 {main}
  thrown in %s on line 2


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-24 11:36 UTC]
-Package: SQLite +Package: SQLite related -Assigned To: +Assigned To: cmb
 [2016-07-24 11:36 UTC]
As Sqlite3 already supports the :memory: pseudo filename, it would
make sense to also support empty filenames.

BTW: the other bug you're mentioning refers to the SQLite
extension, which is unmaintained since a long time anyway.
 [2016-07-27 17:16 UTC]
-Status: Assigned +Status: Closed
 [2016-07-27 17:16 UTC]
The PR has been merged; closing.
 [2016-07-27 17:18 UTC] nazar at mokrynskyi dot com
Thanks for the quick fix!
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 30 07:01:30 2024 UTC