With the release of PHP 8.1, developers using ZTS (Zend Thread Safety) and the parallel extension gained another convenient tool for inter-thread communication: a shared in-memory SQLite database that can be configured with a single DSN string. This approach turns out to be simpler and more intuitive than the standard parallel\Channel or custom sockets.
PHP with ZTS enabled allows code to run concurrently in multiple threads. The parallel extension provides a high-level API for this: parallel\Runtime, parallel\Future, parallel\Channel. Threads are isolated, so to exchange data you must either use channels (parallel\Channel) or implement your own data exchange mechanism via sockets, files, or shared memory. While this works, it requires extra code/extensions/experience and is not always convenient.
Starting with PHP 8.1, PDO SQLite supports a special DSN format using URIs, which allows the same in-memory database to b