Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/ZendAccelerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
9 changes: 9 additions & 0 deletions ext/opcache/zend_accelerator_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion ext/pgsql/pgsql.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions ext/pgsql/pgsql_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions ext/pgsql/tests/pg_close_stmt_parameter_type.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--TEST--
pg_close_stmt(): the connection parameter is typed like every other pgsql function
--EXTENSIONS--
pgsql
--SKIPIF--
<?php
if (!function_exists('pg_close_stmt')) die('skip pg_close_stmt() requires libpq >= 17');
?>
--FILE--
<?php

foreach (['pg_close_stmt', 'pg_connect_poll'] as $function) {
$parameter = (new ReflectionFunction($function))->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"
50 changes: 50 additions & 0 deletions sapi/fpm/tests/gh23288-opcache-interned-strings-buffer-pool.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
--TEST--
FPM: GH-23288 - opcache.interned_strings_buffer overridden per pool must not crash on restart
--EXTENSIONS--
opcache
--SKIPIF--
<?php include "skipif.inc"; ?>
--FILE--
<?php

require_once "tester.inc";

$cfg = <<<EOT
[global]
error_log = {{FILE:LOG}}
[unconfined]
listen = {{ADDR}}
pm = static
pm.max_children = 1
php_admin_value[opcache.interned_strings_buffer] = 8
EOT;

$code = <<<EOT
<?php
opcache_reset();
opcache_reset();
echo "ok";
EOT;

$opcache = ini_get('extension_dir') . DIRECTORY_SEPARATOR . 'opcache.' . PHP_SHLIB_SUFFIX;
$extraArgs = is_file($opcache) ? ['-dzend_extension=' . $opcache] : [];

$tester = new FPM\Tester($cfg, $code);
$tester->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--
<?php
require_once "tester.inc";
FPM\Tester::clean();
?>