From 8ff2f2f84b2c0ea33b38f7e98aaa710ce4f3fc91 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 21 Sep 2020 17:20:28 +0200 Subject: Return empty array for no rows in pg_fetch_all() This makes it line up with pg_fetch_all_columns(), as well as similar functions in other exts, such as mysqli_fetch_all(). --- ext/pgsql/tests/03sync_query.phpt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ext/pgsql/tests/03sync_query.phpt') diff --git a/ext/pgsql/tests/03sync_query.phpt b/ext/pgsql/tests/03sync_query.phpt index ce062cafd6..cc3b1b86b9 100644 --- a/ext/pgsql/tests/03sync_query.phpt +++ b/ext/pgsql/tests/03sync_query.phpt @@ -125,6 +125,7 @@ try { $result = pg_query($db, "INSERT INTO ".$table_name." VALUES (9999, 'ABC');"); pg_last_oid($result); +var_dump(pg_fetch_all($result)); pg_free_result($result); pg_close($db); @@ -144,4 +145,6 @@ pg_field_name(): Argument #2 ($field_number) must be greater than or equal to 0 pg_field_name(): Argument #2 ($field_number) must be less than the number of fields for this result set pg_field_table(): Argument #2 ($field_number) must be greater than or equal to 0 pg_field_table(): Argument #2 ($field_number) must be less than the number of fields for this result set +array(0) { +} OK -- cgit v1.2.1