[php-src] master: ext/sqlite3: user zend_string* instead of char* for extension global (#24303)

From: Date: Wed, 14 Oct 2026 11:44:12 +0000
Subject: [php-src] master: ext/sqlite3: user zend_string* instead of char* for extension global (#24303)
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-142247@lists.php.net to get a copy of this message
Author: Gina Peter Banyard (Girgias) Committer: GitHub (web-flow) Pusher: Girgias Date: 2026-10-14T12:44:03+01:00 Commit: https://github.com/php/php-src/commit/97a581232fba43f7bb87eb6a9893cee4e724d930 Raw diff: https://github.com/php/php-src/commit/97a581232fba43f7bb87eb6a9893cee4e724d930.diff ext/sqlite3: user zend_string* instead of char* for extension global (#24303) This allows us to prevent a needless strlen() computation Changed paths: M ext/sqlite3/php_sqlite3.h M ext/sqlite3/sqlite3.c Diff: diff --git a/ext/sqlite3/php_sqlite3.h b/ext/sqlite3/php_sqlite3.h index 8a9cf3af1598..47441619bdc5 100644 --- a/ext/sqlite3/php_sqlite3.h +++ b/ext/sqlite3/php_sqlite3.h @@ -21,7 +21,7 @@ extern zend_module_entry sqlite3_module_entry; #define phpext_sqlite3_ptr &sqlite3_module_entry ZEND_BEGIN_MODULE_GLOBALS(sqlite3) - char *extension_dir; + zend_string *extension_dir; int dbconfig_defensive; ZEND_END_MODULE_GLOBALS(sqlite3) diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index dbff6508367c..3ad5a5b9a839 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -60,7 +60,7 @@ static zend_always_inline void php_sqlite3_fetch_one(int n_cols, php_sqlite3_res /* {{{ PHP_INI */ PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("sqlite3.extension_dir", NULL, PHP_INI_SYSTEM, OnUpdateString, extension_dir, zend_sqlite3_globals, sqlite3_globals) + STD_PHP_INI_ENTRY("sqlite3.extension_dir", NULL, PHP_INI_SYSTEM, OnUpdateStr, extension_dir, zend_sqlite3_globals, sqlite3_globals) #if SQLITE_VERSION_NUMBER >= 3026000 STD_PHP_INI_BOOLEAN("sqlite3.defensive", "1", PHP_INI_USER, OnUpdateBool, dbconfig_defensive, zend_sqlite3_globals, sqlite3_globals) #endif @@ -415,8 +415,8 @@ PHP_METHOD(SQLite3, loadExtension) RETURN_THROWS(); } - extension_dir = SQLITE3G(extension_dir); - extension_dir_len = strlen(SQLITE3G(extension_dir)); + extension_dir = ZSTR_VAL(SQLITE3G(extension_dir)); + extension_dir_len = ZSTR_LEN(SQLITE3G(extension_dir)); if (IS_SLASH(extension_dir[extension_dir_len-1])) { spprintf(&lib_path, 0, "%s%s", extension_dir, extension);

« previous php.cvs (#142247) next »