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 @@ -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
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 @@ -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),
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 @@ -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<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 {}
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.

29 changes: 29 additions & 0 deletions ext/pgsql/tests/gh25802.phpt
Original file line number Diff line number Diff line change
@@ -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)
Loading