Skip to content
Closed
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
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ PHP NEWS
keeps a reference and the result is discarded). (Tomasz Kowalczyk)
. Fixed bug GH-25802 (pg_get_notify() result is never === false with opcache
enabled). (Tomasz Kowalczyk)
. Fixed bug GH-25825 (pg_meta_data() numeric column names are not integer keys
with opcache enabled). (Tomasz Kowalczyk)

- Phar:
. Fixed bug GH-25528 (Phar::setSignatureAlgorithm(): OpenSSL signing reads a
Expand Down
2 changes: 1 addition & 1 deletion Zend/Optimizer/zend_func_infos.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ static const func_info_t func_infos[] = {
F1("pg_result_status", MAY_BE_STRING|MAY_BE_LONG),
F1("pg_get_notify", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
F1("pg_socket", MAY_BE_RESOURCE|MAY_BE_FALSE),
F1("pg_meta_data", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_FALSE),
F1("pg_meta_data", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_FALSE),
F1("pg_convert", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_FALSE),
F1("pg_insert", MAY_BE_OBJECT|MAY_BE_STRING|MAY_BE_BOOL),
F1("pg_update", MAY_BE_STRING|MAY_BE_BOOL),
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 @@ -924,7 +924,7 @@ function pg_consume_input(PgSql\Connection $connection): bool {}
function pg_flush(PgSql\Connection $connection): int|bool {}

/**
* @return array<string, array>|false
* @return array<int|string, array>|false
* @refcount 1
*/
function pg_meta_data(PgSql\Connection $connection, string $table_name, bool $extended = false): array|false {}
Expand Down
2 changes: 1 addition & 1 deletion ext/pgsql/pgsql_arginfo.h

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

35 changes: 35 additions & 0 deletions ext/pgsql/tests/gh25825.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
--TEST--
GH-25825: pg_meta_data() numeric column names are not integer keys with opcache enabled
--EXTENSIONS--
pgsql
opcache
--SKIPIF--
<?php include("inc/skipif.inc"); ?>
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
--FILE--
<?php
include('inc/config.inc');
$table = 'pg_meta_data_numeric_column';

function check(PgSql\Connection $db, string $table): void {
foreach (pg_meta_data($db, $table) as $name => $meta) {
var_dump($name, is_int($name));
}
}

$db = pg_connect($conn_str);
pg_query($db, "CREATE TABLE {$table} (\"123\" integer)");
check($db, $table);
?>
--CLEAN--
<?php
include('inc/config.inc');
$db = pg_connect($conn_str);
pg_query($db, 'DROP TABLE IF EXISTS pg_meta_data_numeric_column');
?>
--EXPECT--
int(123)
bool(true)
Loading