When I create a SQLite memory database - how do I delete it when I'm finished? Is it automatically released when the script ends and closes the connection?
$pdo = new PDO('sqlite::memory:');
The most common way to force an SQLite database to exist purely in memory is to open the database using the special filename ":memory:"... ...When this is done, no disk file is opened. Instead, a new database is created purely in memory. The database ceases to exist as soon as the database connection is closed. Every :memory: database is distinct from every other. So, opening two database connections each with the filename ":memory:" will create two independent in-memory databases. - SQLite
Yes, that's what happens.
$pdo = NULL;) to get the memory released before script execution ends (if you're using it in a lengthy unit testing suite, for example)