diff --git a/NEWS b/NEWS index e42393462d83..e12f30201909 100644 --- a/NEWS +++ b/NEWS @@ -175,6 +175,8 @@ PHP NEWS - PGSQL: . Fixed bug GH-25772 (pg_fetch_object() crashes with JIT when the constructor 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) - 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 ce6369193014..632e7bf98bad 100644 --- a/Zend/Optimizer/zend_func_infos.h +++ b/Zend/Optimizer/zend_func_infos.h @@ -333,7 +333,7 @@ static const func_info_t func_infos[] = { F1("pg_result_error_field", MAY_BE_STRING|MAY_BE_FALSE|MAY_BE_NULL), F1("pg_get_result", MAY_BE_OBJECT|MAY_BE_FALSE), 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), + 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_convert", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_FALSE), diff --git a/ext/pgsql/pgsql.stub.php b/ext/pgsql/pgsql.stub.php index 31774ed56fee..e9c5c3922292 100644 --- a/ext/pgsql/pgsql.stub.php +++ b/ext/pgsql/pgsql.stub.php @@ -906,7 +906,7 @@ function pg_get_result(PgSql\Connection $connection): PgSql\Result|false {} function pg_result_status(PgSql\Result $result, int $mode = PGSQL_STATUS_LONG): string|int {} /** - * @return array + * @return array|false * @refcount 1 */ function pg_get_notify(PgSql\Connection $connection, int $mode = PGSQL_ASSOC): array|false {} diff --git a/ext/pgsql/pgsql_arginfo.h b/ext/pgsql/pgsql_arginfo.h index 3839f550edbd..5ee977a14f04 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: 891bd725ce4b52880ee9349861a15537541bd0ed */ + * Stub hash: 34a8f9c339c47db2dedd5db3bae59abd9ae66c7a */ 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/gh25802.phpt b/ext/pgsql/tests/gh25802.phpt new file mode 100644 index 000000000000..2a1fa2711e08 --- /dev/null +++ b/ext/pgsql/tests/gh25802.phpt @@ -0,0 +1,29 @@ +--TEST-- +GH-25802: pg_get_notify() result is never === false with opcache enabled +--EXTENSIONS-- +pgsql +opcache +--SKIPIF-- + +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +--FILE-- + +--EXPECT-- +bool(true) +bool(false)