[php-src] master: Merge branch 'PHP-8.4' into PHP-8.5
| From: | David Carlier | Date: | Fri, 27 Nov 2026 04:45:08 +0000 |
| Subject: | [php-src] master: Merge branch 'PHP-8.4' into PHP-8.5 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-144244@lists.php.net to get a copy of this message | ||
Author: David Carlier (devnexen)
Date: 2026-11-27T04:41:11Z
Commit: https://github.com/php/php-src/commit/f678966cbe66d8170ab4ebcfcf42a7d6a549f67f
Raw diff: https://github.com/php/php-src/commit/f678966cbe66d8170ab4ebcfcf42a7d6a549f67f.diff
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
ext/pgsql: pg_get_notify() result is never === false with opcache enabled
# Conflicts:
# ext/pgsql/pgsql_arginfo.h
Changed paths:
A ext/pgsql/tests/gh25802.phpt
M Zend/Optimizer/zend_func_infos.h
M ext/pgsql/pgsql.stub.php
M ext/pgsql/pgsql_arginfo.h
Diff:
diff --git a/Zend/Optimizer/zend_func_infos.h b/Zend/Optimizer/zend_func_infos.h
index f175dffea604..9a2a0504ae8b 100644
--- a/Zend/Optimizer/zend_func_infos.h
+++ b/Zend/Optimizer/zend_func_infos.h
@@ -332,7 +332,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 b017f422550c..efd65acf9151 100644
--- a/ext/pgsql/pgsql.stub.php
+++ b/ext/pgsql/pgsql.stub.php
@@ -905,7 +905,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<int|string, int|string>
+ * @return array<int|string, int|string>|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 e973a3f99fb0..34f27852ae69 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: cb9cff27c7143b17cc0ad3a24af11b77c4ce7a06 */
+ * Stub hash: 7a97b9105de8dd1e02e039e99f3c95d0b3ca262d */
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--
+<?php include("inc/skipif.inc"); ?>
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.file_update_protection=0
+--FILE--
+<?php
+include('inc/config.inc');
+
+function check(PgSql\Connection $db): void {
+ $msg = pg_get_notify($db);
+ var_dump($msg === false);
+}
+
+$db = pg_connect($conn_str);
+check($db);
+pg_query($db, 'LISTEN pg_get_notify_false');
+pg_query($db, 'NOTIFY pg_get_notify_false');
+check($db);
+?>
+--EXPECT--
+bool(true)
+bool(false)