Category
stdlib · php-src-strict · PDO statement API
Problem
PDO + PDOStatement::fetch() / fetchAll() / bindValue() / execute() work on the VM sqlite path, but core statement methods from php-src are missing (method_exists false → Fatal on call). Zend ext/pdo exposes the full statement surface.
Observed on VM (2026-07-17) after PDO('sqlite::memory:') + query():
| Method |
VM |
fetch / fetchAll / bindValue / execute |
present |
fetchColumn / fetchObject / bindColumn |
missing |
rowCount / columnCount / getColumnMeta |
missing |
nextRowset / closeCursor / bindParam |
missing |
errorCode / errorInfo / setFetchMode |
missing |
getAttribute / setAttribute / debugDumpParams |
missing |
Minimal user-facing gap: fetchColumn() is widely used and should return the next row’s column value like Zend.
php-src reference
PHP implementation target
ext/pdo/ (or existing PDO builtin module) — implement PDOStatement methods in PHP + JIT lowering; thin ABI only if unavoidable
- Prefer shipping
fetchColumn + rowCount + closeCursor first; others can follow in child issues if needed
- No new C logic in
runtime/ beyond existing PDO trampolines
Repro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
cat > /tmp/pdo_fetch_column.php <<'"'"'PHP'"'"'
<?php
$pdo = new PDO("sqlite::memory:");
$pdo->exec("CREATE TABLE t(id INTEGER); INSERT INTO t VALUES (7);");
$st = $pdo->query("SELECT id FROM t");
echo "has_fetchColumn=", method_exists($st, "fetchColumn") ? "yes" : "no", "\n";
if (method_exists($st, "fetchColumn")) {
echo "col=", $st->fetchColumn(0), "\n";
} else {
try { $st->fetchColumn(0); } catch (Throwable $e) { echo get_class($e), ": ", $e->getMessage(), "\n"; }
}
PHP
php bin/vm.php /tmp/pdo_fetch_column.php
'
Done when
Related
#3367 (closed PDO subset epic) · #19821 (SQLite3 API) · #10533 pillar 4
Category
stdlib· php-src-strict · PDO statement APIProblem
PDO+PDOStatement::fetch()/fetchAll()/bindValue()/execute()work on the VM sqlite path, but core statement methods from php-src are missing (method_existsfalse → Fatal on call). Zendext/pdoexposes the full statement surface.Observed on VM (2026-07-17) after
PDO('sqlite::memory:')+query():fetch/fetchAll/bindValue/executefetchColumn/fetchObject/bindColumnrowCount/columnCount/getColumnMetanextRowset/closeCursor/bindParamerrorCode/errorInfo/setFetchModegetAttribute/setAttribute/debugDumpParamsMinimal user-facing gap:
fetchColumn()is widely used and should return the next row’s column value like Zend.php-src reference
ext/pdo/pdo_stmt.c—zim_PDOStatement_fetchColumn,fetchObject,rowCount, …ext/pdo/pdo_stmt.stub.php— method signaturesPHP implementation target
ext/pdo/(or existing PDO builtin module) — implementPDOStatementmethods in PHP + JIT lowering; thin ABI only if unavoidablefetchColumn+rowCount+closeCursorfirst; others can follow in child issues if neededruntime/beyond existing PDO trampolinesRepro
Done when
PDOStatement::fetchColumn($column = 0)matches Zend (returns scalar / false when exhausted)rowCount()andcloseCursor()present and php-src-strict for sqlite.phptundertest/compliance/cases/pdo/Related
#3367 (closed PDO subset epic) · #19821 (SQLite3 API) · #10533 pillar 4