Skip to content

Stdlib: SQLite3::open/backup/createAggregate/createCollation/loadExtension/version/lastError* still missing after #19862 (ext/sqlite3/sqlite3.stub.php) #20565

Description

@PurHur

Category

stdlib · php-src-strict · ext/sqlite3 · pillar 4

Problem

#19862 / #19821 restored query/prepare/createFunction/busyTimeout/enableExceptions, but several stub methods remain unregistered. Apps that reopen DBs via open(), use aggregates/collations, backup, load extensions, or read lastError* still fatal.

Verified 2026-07-18 (PHP_COMPILER_PROFILE=8.4, VM) — get_class_methods(SQLite3):

Present: __construct, close, query, exec, prepare, createFunction, enableExceptions, busyTimeout, lastInsertRowID, changes, escapeString, querySingle

Missing vs php-src stub:

Method php-src VM
open present missing
createAggregate present missing
createCollation present missing
backup present missing
loadExtension present missing
version (static) present missing
totalChanges present missing
lastErrorCode / lastErrorMsg present missing
$db = new SQLite3(':memory:');
$db->open(':memory:'); // Error: Call to undefined method SQLite3::open()

php-src reference

PHP implementation target

  • ext/sqlite3/ PHP-in-PHP handlers mirroring existing createFunction / query patterns
  • open can share construct/open path; lastError* read from connection state already tracked for exec failures
  • No new runtime/*.c

Repro

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && PHP_COMPILER_PROFILE=8.4 php bin/vm.php -r "
foreach ([\"open\",\"backup\",\"createAggregate\",\"createCollation\",\"loadExtension\",\"version\",\"totalChanges\",\"lastErrorCode\",\"lastErrorMsg\",\"createFunction\"] as \$m) {
  echo \$m, \": \", method_exists(SQLite3::class, \$m) ? \"yes\" : \"NO\", PHP_EOL;
}
"'

Done when

  • open, lastErrorCode, lastErrorMsg, totalChanges, version registered and match Zend semantics on happy path
  • createAggregate or createCollation implemented (other may be follow-up)
  • backup and/or loadExtension implemented or split follow-up issue
  • Compliance/repro guard; php-src-strict; no new C

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machineenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions