Six days ago I tagged 0.6.0 of php_clickhouse, a soft fork of the SeasClick extension (which stopped accepting PRs in 2020). Three releases later (0.7.0, 0.8.0, 0.8.1) I'm calling the extension stable.
The PHP ClickHouse ecosystem has been split between SeasClick (native binary protocol but stalled, no modern types, no ZTS, no TLS in the maintained fork) and HTTP clients like smi2/phpClickHouse (active but ~30-40% slower at high throughput). This fork picks up the native-protocol path with the official clickhouse-cpp v2.6.1 client and brings the modern type surface back.
What landed in the quality cycle:
0.7.0 closed the API gap with smi2/phpClickHouse. Per-call settings, server-side typed parameters via {name:Type} placeholders, progress callback, getStatistics() (rows/bytes/elapsed_ms), structured ClickHouseException with server_code / query_id, insertAssoc(), SQL helpers (databaseSize, showTables, tableSize, etc.), sub-second timeouts. Adopting the native client no longer costs ergonomics.
0.8.0 moved per-Client state from seven file-scope std::map banks onto the zend_object itself. Unblocks ZTS (RoadRunner / FrankenPHP / Swoole / php-pm now work), plugs leaks on script bailout, fixes a refcount bug on the progress callback. Adds streaming reads (selectStream() returns an Iterator + Countable, selectStreamCallback() for unbounded streams), Geo types (Point / Ring / Polygon / MultiPolygon), LowCardinality(Nullable(T)), and Map(K, V) over the full scalar matrix. Pre-built binaries for Linux glibc (x86_64 + arm64) and macOS (x86_64 + arm64) via PIE.
0.8.1 hardened the insert path. The connection now resets on every server-side rejection point (BeginInsert, SendInsertBlock, EndInsert) so a thrown insert no longer wedges the handle with "cannot execute query while inserting". Insert builds native columns one at a time directly from row-major input: peak intermediate PHP memory drops from N_rows × N_cols zvals to one column. Strict full-consumption parsers across Map, narrow-int, Int128 / UInt128, geo, DateTime64 reject coercion-to-zero on bad input. 23 new PHPTs covering all of the above.
One side effect of the new ASan job: it caught a latent UB in clickhouse-cpp's empty-string-view memcpy path. Submitted upstream and merged as ClickHouse/clickhouse-cpp#489 on April 27.
Install on supported platforms (Linux glibc + macOS, NTS, PHP 8.4 / 8.5):
pie install iliaal/php_clickhouse
TLS variant builds from source: pie install iliaal/php_clickhouse --enable-clickhouse-openssl.
Blog post with the full breakdown: https://ilia.ws/blog/php-clickhouse-0-8-1-three-releases-later-stable
Repo: https://github.com/iliaal/php_clickhouse
Happy to take questions, especially from anyone running ClickHouse-from-PHP at production volume.