Skip to content

Commit 696235d

Browse files
committed
Instances of object returned by db2_*() functions are always instances of stdClass
1 parent 0af91df commit 696235d

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
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

ibm_db2_arginfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 3e863612a7a676e042e024f6778b791bd086abe5 */
2+
* Stub hash: e952caf6e14487291104ab1f1fdd7f268cc8a6bc */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_db2_connect, 0, 0, 3)
55
ZEND_ARG_TYPE_INFO(0, database, IS_STRING, 0)
@@ -205,7 +205,7 @@ ZEND_END_ARG_INFO()
205205

206206
#define arginfo_db2_fetch_both arginfo_db2_fetch_assoc
207207

208-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_db2_fetch_object, 0, 1, MAY_BE_OBJECT|MAY_BE_FALSE)
208+
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_db2_fetch_object, 0, 1, stdClass, MAY_BE_FALSE)
209209
ZEND_ARG_INFO(0, stmt)
210210
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, row_number, IS_LONG, 1, "null")
211211
ZEND_END_ARG_INFO()
@@ -220,7 +220,7 @@ ZEND_END_ARG_INFO()
220220

221221
#define arginfo_db2_setoption arginfo_db2_set_option
222222

223-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_db2_client_info, 0, 1, MAY_BE_OBJECT|MAY_BE_FALSE)
223+
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_db2_client_info, 0, 1, stdClass, MAY_BE_FALSE)
224224
ZEND_ARG_INFO(0, connection)
225225
ZEND_END_ARG_INFO()
226226

ibm_db2_legacy_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 3e863612a7a676e042e024f6778b791bd086abe5 */
2+
* Stub hash: e952caf6e14487291104ab1f1fdd7f268cc8a6bc */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_db2_connect, 0, 0, 3)
55
ZEND_ARG_INFO(0, database)

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)