Category
stdlib
Problem
Embedded SQLite via SQLite3 class (not only PDO) is common in tooling, tests, and desktop PHP apps. This repo has no ext/sqlite3 module — class_exists('SQLite3') is false and new SQLite3(':memory:') fatals.
PDO sqlite is tracked separately (#3367). This issue is the procedural/OOP SQLite3 API from ext/sqlite3.
php-src reference
Repro (failure today)
test/repro/maintainer_sqlite3_memory.php:
<?php
var_export(class_exists('SQLite3'));
echo "\n";
$db = new SQLite3(':memory:');
$db->exec('CREATE TABLE t (v TEXT)');
$db->exec("INSERT INTO t VALUES ('ok')");
echo $db->querySingle('SELECT v FROM t'), "\n";
$db->close();
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php test/repro/maintainer_sqlite3_memory.php
php bin/vm.php test/repro/maintainer_sqlite3_memory.php 2>&1 | head -3
'
| Runtime |
Output |
| Zend PHP + ext/sqlite3 |
true then ok |
bin/vm.php |
false / Class "SQLite3" not found |
Scope (v1 subset — this repo)
| Area |
Path |
| Module |
ext/sqlite3/Module.php, BuiltinClasses.php |
| VM class |
SQLite3 with __construct($filename), exec(), querySingle(), close() |
| Constants |
SQLITE3_ASSOC, SQLITE3_NUM, SQLITE3_BOTH, SQLITE3_OK, SQLITE3_ERROR |
| Native link |
libsqlite3 via AOT runtime / FFI (mirror #3367 PDO sqlite linking) |
| Tests |
test/compliance/cases/stdlib/sqlite3_memory.phpt |
| Matrix |
script/capability-matrix.php |
Phase 2: SQLite3Stmt, SQLite3Result, createFunction, loadExtension (likely disabled), openBlob.
PHP-in-PHP: SQL execution wrappers in ext/sqlite3/*.php; C only for sqlite3_* FFI trampolines.
Done when
Verification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter sqlite3_memory'
Links
Category
stdlibProblem
Embedded SQLite via
SQLite3class (not only PDO) is common in tooling, tests, and desktop PHP apps. This repo has noext/sqlite3module —class_exists('SQLite3')is false andnew SQLite3(':memory:')fatals.PDO sqlite is tracked separately (#3367). This issue is the procedural/OOP
SQLite3API fromext/sqlite3.php-src reference
ext/sqlite3/sqlite3.c—php_sqlite3_object,PHP_METHOD(SQLite3, open),exec,query,closeext/sqlite3/sqlite3_arginfo.h— method signatures,SQLITE3_*constantsext/sqlite3/sqlite3stmt.c—SQLite3Stmt(phase 2)Repro (failure today)
test/repro/maintainer_sqlite3_memory.php:truethenokbin/vm.phpfalse/Class "SQLite3" not foundScope (v1 subset — this repo)
ext/sqlite3/Module.php,BuiltinClasses.phpSQLite3with__construct($filename),exec(),querySingle(),close()SQLITE3_ASSOC,SQLITE3_NUM,SQLITE3_BOTH,SQLITE3_OK,SQLITE3_ERRORlibsqlite3via AOT runtime / FFI (mirror #3367 PDO sqlite linking)test/compliance/cases/stdlib/sqlite3_memory.phptscript/capability-matrix.phpPhase 2:
SQLite3Stmt,SQLite3Result,createFunction,loadExtension(likely disabled),openBlob.PHP-in-PHP: SQL execution wrappers in
ext/sqlite3/*.php; C only forsqlite3_*FFI trampolines.Done when
truethenokon VMclass_exists('SQLite3')true after module initexec()returnsfalse;lastErrorMsg()non-empty (Zend subset)./script/ci-fast.sh --filter sqlite3_memorygreenlibsqlite3dependency (same as PDO sqlite if shared)Verification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter sqlite3_memory'Links