Skip to content

Commit 643cd69

Browse files
committed
Instances of object returned by db2_*() functions are always instances of stdClass
1 parent 61b806f commit 643cd69

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

ibm_db2.stub.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ function db2_fetch_both($stmt, ?int $row_number = null): array|false {}
288288
/**
289289
* @param resource $stmt
290290
*/
291-
function db2_fetch_object($stmt, ?int $row_number = null): object|false {}
291+
function db2_fetch_object($stmt, ?int $row_number = null): \stdClass|false {}
292292

293293
/**
294294
* @param resource $stmt
@@ -309,12 +309,12 @@ function db2_setoption($resource, array $options, int $type): bool {}
309309
/**
310310
* @param resource $connection
311311
*/
312-
function db2_client_info($connection): object|false {}
312+
function db2_client_info($connection): \stdClass|false {}
313313

314314
/**
315315
* @param resource $connection
316316
*/
317-
function db2_server_info($connection): object|false {}
317+
function db2_server_info($connection): \stdClass|false {}
318318

319319
function db2_escape_string(string $string_literal): string {}
320320

tests/test_V6_310_ClientInfo.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $conn = db2_connect($database, $user, $password);
1111

1212
$client = db2_client_info( $conn );
1313

14-
if ($client) {
14+
if ($client instanceof \stdClass) {
1515
echo "DRIVER_NAME: "; var_dump( $client->DRIVER_NAME );
1616
echo "DRIVER_VER: "; var_dump( $client->DRIVER_VER );
1717
echo "DATA_SOURCE_NAME: "; var_dump( $client->DATA_SOURCE_NAME );
@@ -34,4 +34,3 @@ DRIVER_VER: string(%d) %s
3434
DATA_SOURCE_NAME: string(%d) %s
3535
DRIVER_ODBC_VER: string(%d) %s
3636
ODBC_SQL_CONFORMANCE: string(%d) %s
37-

0 commit comments

Comments
 (0)