diff --git a/NEWS b/NEWS index 78265622e7d7..887ff5b3401d 100644 --- a/NEWS +++ b/NEWS @@ -58,6 +58,10 @@ PHP NEWS left busy for the next fetch, and rows delivered from a result another statement took over. (KentarouTakeda) +- PGSQL: + . Fixed the class name casing of pg_close_stmt()'s connection parameter. + (lacatoire) + - Phar: . Fixed Phar archives being automatically detected when ".phar" only occurs in a directory name or is not a filename extension in an included file's diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 96bf83a35527..f4bdcf3e7f7a 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2945,7 +2945,7 @@ ZEND_RINIT_FUNCTION(zend_accelerator) zend_reset_cache_vars(); zend_accel_hash_clean(&ZCSG(hash)); - if (ZCG(accel_directives).interned_strings_buffer) { + if (ZCSG(interned_strings).saved_top) { accel_interned_strings_restore_state(); } diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 465b15cd9576..a513627414ac 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -102,6 +102,15 @@ static ZEND_INI_MH(OnUpdateMemoryConsumption) static ZEND_INI_MH(OnUpdateInternedStringsBuffer) { + if (accel_startup_ok) { + if (strcmp(sapi_module.name, "fpm-fcgi") == 0) { + zend_accel_error(ACCEL_LOG_WARNING, "opcache.interned_strings_buffer cannot be changed when OPcache is already set up. Are you using php_admin_value[opcache.interned_strings_buffer] in an individual pool's configuration?\n"); + } else { + zend_accel_error(ACCEL_LOG_WARNING, "opcache.interned_strings_buffer cannot be changed when OPcache is already set up.\n"); + } + return FAILURE; + } + zend_long *p = ZEND_INI_GET_ADDR(); zend_long size = zend_ini_parse_quantity_warn(new_value, entry->name); diff --git a/ext/pgsql/pgsql.stub.php b/ext/pgsql/pgsql.stub.php index 52ddc3b3748a..8c5a7f4c6d98 100644 --- a/ext/pgsql/pgsql.stub.php +++ b/ext/pgsql/pgsql.stub.php @@ -956,7 +956,7 @@ function pg_socket_poll($socket, int $read, int $write, int $timeout = -1): int function pg_set_chunked_rows_size(PgSql\Connection $connection, int $size): bool {} #endif #ifdef HAVE_PG_CLOSE_STMT - function pg_close_stmt(Pgsql\Connection $connection, string $statement_name): PgSql\Result|false {} + function pg_close_stmt(PgSql\Connection $connection, string $statement_name): PgSql\Result|false {} #endif } diff --git a/ext/pgsql/pgsql_arginfo.h b/ext/pgsql/pgsql_arginfo.h index 63a1d185d535..974a6e9117cd 100644 --- a/ext/pgsql/pgsql_arginfo.h +++ b/ext/pgsql/pgsql_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit pgsql.stub.php instead. - * Stub hash: f25b5a574c96d4bc2f08b8cacab16f499a164a6b */ + * Stub hash: fa7cd778f4e791b15ffc8f1786384332449bda5a */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_pg_connect, 0, 1, PgSql\\Connection, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, connection_string, IS_STRING, 0) @@ -503,7 +503,7 @@ ZEND_END_ARG_INFO() #if defined(HAVE_PG_CLOSE_STMT) ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_pg_close_stmt, 0, 2, PgSql\\Result, MAY_BE_FALSE) - ZEND_ARG_OBJ_INFO(0, connection, Pgsql\\Connection, 0) + ZEND_ARG_OBJ_INFO(0, connection, PgSql\\Connection, 0) ZEND_ARG_TYPE_INFO(0, statement_name, IS_STRING, 0) ZEND_END_ARG_INFO() #endif diff --git a/ext/pgsql/tests/pg_close_stmt_parameter_type.phpt b/ext/pgsql/tests/pg_close_stmt_parameter_type.phpt new file mode 100644 index 000000000000..c9c6c4f40ad5 --- /dev/null +++ b/ext/pgsql/tests/pg_close_stmt_parameter_type.phpt @@ -0,0 +1,22 @@ +--TEST-- +pg_close_stmt(): the connection parameter is typed like every other pgsql function +--EXTENSIONS-- +pgsql +--SKIPIF-- += 17'); +?> +--FILE-- +getParameters()[0]; + printf("%-16s %s\n", $function, $parameter->getType()); +} + +var_dump((new ReflectionClass(PgSql\Connection::class))->getName()); +?> +--EXPECT-- +pg_close_stmt PgSql\Connection +pg_connect_poll PgSql\Connection +string(16) "PgSql\Connection" diff --git a/sapi/fpm/tests/gh23288-opcache-interned-strings-buffer-pool.phpt b/sapi/fpm/tests/gh23288-opcache-interned-strings-buffer-pool.phpt new file mode 100644 index 000000000000..8f48b3a8c209 --- /dev/null +++ b/sapi/fpm/tests/gh23288-opcache-interned-strings-buffer-pool.phpt @@ -0,0 +1,50 @@ +--TEST-- +FPM: GH-23288 - opcache.interned_strings_buffer overridden per pool must not crash on restart +--EXTENSIONS-- +opcache +--SKIPIF-- + +--FILE-- +start($extraArgs, iniEntries: ['opcache.interned_strings_buffer' => '0']); +$tester->expectLogStartNotices(); +$tester->request()->expectBody('ok'); +$tester->request()->expectBody('ok'); +$tester->request()->expectBody('ok'); +$tester->terminate(); +$tester->expectLogTerminatingNotices(); +$tester->close(); + +?> +Done +--EXPECT-- +Done +--CLEAN-- +