diff --git a/NEWS b/NEWS index d982a1008b1d..faa047b93fa9 100644 --- a/NEWS +++ b/NEWS @@ -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 diff --git a/Zend/Optimizer/zend_func_infos.h b/Zend/Optimizer/zend_func_infos.h index 632e7bf98bad..ba1f5bf2f8ec 100644 --- a/Zend/Optimizer/zend_func_infos.h +++ b/Zend/Optimizer/zend_func_infos.h @@ -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), diff --git a/ext/pgsql/pgsql.stub.php b/ext/pgsql/pgsql.stub.php index e9c5c3922292..83c17f631be7 100644 --- a/ext/pgsql/pgsql.stub.php +++ b/ext/pgsql/pgsql.stub.php @@ -924,7 +924,7 @@ function pg_consume_input(PgSql\Connection $connection): bool {} function pg_flush(PgSql\Connection $connection): int|bool {} /** - * @return array|false + * @return array|false * @refcount 1 */ function pg_meta_data(PgSql\Connection $connection, string $table_name, bool $extended = false): array|false {} diff --git a/ext/pgsql/pgsql_arginfo.h b/ext/pgsql/pgsql_arginfo.h index 5ee977a14f04..8d6f74f427d2 100644 --- a/ext/pgsql/pgsql_arginfo.h +++ b/ext/pgsql/pgsql_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 34a8f9c339c47db2dedd5db3bae59abd9ae66c7a */ + * Stub hash: 9ecfc41695d80755098037d9e195487417fcff36 */ 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) diff --git a/ext/pgsql/tests/gh25825.phpt b/ext/pgsql/tests/gh25825.phpt new file mode 100644 index 000000000000..feb751b80fe4 --- /dev/null +++ b/ext/pgsql/tests/gh25825.phpt @@ -0,0 +1,35 @@ +--TEST-- +GH-25825: pg_meta_data() numeric column names are not integer keys with opcache enabled +--EXTENSIONS-- +pgsql +opcache +--SKIPIF-- + +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +--FILE-- + $meta) { + var_dump($name, is_int($name)); + } +} + +$db = pg_connect($conn_str); +pg_query($db, "CREATE TABLE {$table} (\"123\" integer)"); +check($db, $table); +?> +--CLEAN-- + +--EXPECT-- +int(123) +bool(true)