Pdo V2.0 Extended Features !!top!! Guide

You can even run multiple queries concurrently:

You can also define custom transformers using #[MapTransformation] to modify values before assignment. 2.3 SQL Logging and Profiling with PDO::enableDebug() Debugging SQL in classic PDO required third-party libraries or manual logging. PDO v2.0 includes a built-in, non-intrusive debugger. pdo v2.0 extended features

$futures = []; foreach ($queries as $sql) $futures[] = $pdo->queryAsync($sql); You can even run multiple queries concurrently: You

A tiny but powerful feature: PDO now supports lazy connections. $futures = []; foreach ($queries as $sql) $futures[]

$pdo->beginTransaction(); try // operation A $pdo->beginTransaction(); // automatically creates a savepoint try // operation B $pdo->commit(); // releases savepoint catch (Throwable $e) $pdo->rollBack(); // rolls back to savepoint, not main transaction

Works with DECIMAL , DATE , JSON , and ENUM types, respecting database introspection. 2.2 Attribute-Based Result Mapping ( #[MapTo] ) Instead of manually assigning columns to properties, PDO v2.0 introduces a PHP 8 attribute for automatic DTO hydration.