diff --git a/ibm_db2.stub.php b/ibm_db2.stub.php index 693548d..71d3012 100644 --- a/ibm_db2.stub.php +++ b/ibm_db2.stub.php @@ -337,4 +337,4 @@ function db2_getoption($resource, string $option): string|false {} /** * @param resource $resource */ -function db2_last_insert_id($resource): string {} +function db2_last_insert_id($resource): ?string {} diff --git a/ibm_db2_arginfo.h b/ibm_db2_arginfo.h index 0d45be1..32aed10 100644 --- a/ibm_db2_arginfo.h +++ b/ibm_db2_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: e952caf6e14487291104ab1f1fdd7f268cc8a6bc */ + * Stub hash: 3cbc4e7e9448199bff07235c7abe69943e4d239d */ ZEND_BEGIN_ARG_INFO_EX(arginfo_db2_connect, 0, 0, 3) ZEND_ARG_TYPE_INFO(0, database, IS_STRING, 0) @@ -243,7 +243,7 @@ ZEND_END_ARG_INFO() #define arginfo_db2_getoption arginfo_db2_get_option -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_db2_last_insert_id, 0, 1, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_db2_last_insert_id, 0, 1, IS_STRING, 1) ZEND_ARG_INFO(0, resource) ZEND_END_ARG_INFO() diff --git a/ibm_db2_legacy_arginfo.h b/ibm_db2_legacy_arginfo.h index 4a02a9e..fb8256e 100644 --- a/ibm_db2_legacy_arginfo.h +++ b/ibm_db2_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: e952caf6e14487291104ab1f1fdd7f268cc8a6bc */ + * Stub hash: 3cbc4e7e9448199bff07235c7abe69943e4d239d */ ZEND_BEGIN_ARG_INFO_EX(arginfo_db2_connect, 0, 0, 3) ZEND_ARG_INFO(0, database) diff --git a/tests/test_last_insert_id.phpt b/tests/test_last_insert_id.phpt index d9b3a3d..ac5935c 100644 --- a/tests/test_last_insert_id.phpt +++ b/tests/test_last_insert_id.phpt @@ -22,7 +22,7 @@ if ($conn) { /* Checking when no insert has been executed. */ $ret = db2_last_insert_id($conn); - if($ret) { + if (null !== $ret) { echo "Last Insert ID is : " . $ret . "\n"; } else { echo "No Last insert ID.\n"; @@ -31,7 +31,7 @@ if ($conn) { /* Inserting many rows from VALUES clause */ $stmt = db2_exec($conn, $insertMany); $ret = db2_last_insert_id($conn); - if($ret) { + if (null !== $ret) { echo "Last Insert ID is : " . $ret . "\n"; } else { echo "No Last insert ID.\n"; @@ -40,7 +40,7 @@ if ($conn) { /* Checking for single row inserted. */ $stmt = db2_exec($conn, $insertTable); $ret = db2_last_insert_id($conn); - if($ret) { + if (null !== $ret) { echo "Last Insert ID is : " . $ret . "\n"; } else { echo "No Last insert ID.\n"; @@ -50,7 +50,7 @@ if ($conn) { for ($i = 0;$i < 5;$i++) { $stmt = db2_exec($conn, $insertTable); $ret = db2_last_insert_id($conn); - if($ret) { + if (null !== $ret) { echo "Last Insert ID is : " . $ret . "\n"; } else { echo "No Last insert ID.\n"; @@ -78,7 +78,7 @@ if ($conn) { $stmt = db2_exec($conn, $insertTable); $ret = db2_last_insert_id($conn); - if($ret) { + if (null !== $ret) { echo "Last Insert ID is : " . $ret . "\n"; } else { echo "No Last insert ID.\n";