Skip to content

Commit 07b2245

Browse files
committed
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4: ext/pgsql: pg_meta_data() numeric column names not integer keys with opcache # Conflicts: # ext/pgsql/pgsql_arginfo.h
2 parents d6fbef9 + 4ca576a commit 07b2245

4 files changed

Lines changed: 38 additions & 3 deletions

File tree

‎Zend/Optimizer/zend_func_infos.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ static const func_info_t func_infos[] = {
334334
F1("pg_result_status", MAY_BE_STRING|MAY_BE_LONG),
335335
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),
336336
F1("pg_socket", MAY_BE_RESOURCE|MAY_BE_FALSE),
337-
F1("pg_meta_data", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_FALSE),
337+
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),
338338
F1("pg_convert", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_FALSE),
339339
F1("pg_insert", MAY_BE_OBJECT|MAY_BE_STRING|MAY_BE_BOOL),
340340
F1("pg_update", MAY_BE_STRING|MAY_BE_BOOL),

‎ext/pgsql/pgsql.stub.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ function pg_consume_input(PgSql\Connection $connection): bool {}
923923
function pg_flush(PgSql\Connection $connection): int|bool {}
924924

925925
/**
926-
* @return array<string, array>|false
926+
* @return array<int|string, array>|false
927927
* @refcount 1
928928
*/
929929
function pg_meta_data(PgSql\Connection $connection, string $table_name, bool $extended = false): array|false {}

‎ext/pgsql/pgsql_arginfo.h‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎ext/pgsql/tests/gh25825.phpt‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
--TEST--
2+
GH-25825: pg_meta_data() numeric column names are not integer keys with opcache enabled
3+
--EXTENSIONS--
4+
pgsql
5+
opcache
6+
--SKIPIF--
7+
<?php include("inc/skipif.inc"); ?>
8+
--INI--
9+
opcache.enable=1
10+
opcache.enable_cli=1
11+
opcache.file_update_protection=0
12+
--FILE--
13+
<?php
14+
include('inc/config.inc');
15+
$table = 'pg_meta_data_numeric_column';
16+
17+
function check(PgSql\Connection $db, string $table): void {
18+
foreach (pg_meta_data($db, $table) as $name => $meta) {
19+
var_dump($name, is_int($name));
20+
}
21+
}
22+
23+
$db = pg_connect($conn_str);
24+
pg_query($db, "CREATE TABLE {$table} (\"123\" integer)");
25+
check($db, $table);
26+
?>
27+
--CLEAN--
28+
<?php
29+
include('inc/config.inc');
30+
$db = pg_connect($conn_str);
31+
pg_query($db, 'DROP TABLE IF EXISTS pg_meta_data_numeric_column');
32+
?>
33+
--EXPECT--
34+
int(123)
35+
bool(true)

0 commit comments

Comments
 (0)