Skip to content

Commit 723d061

Browse files
committed
Implement deprecation for $row less than 1
Should have been done after 8.4 per phpGH-13910.
1 parent 1cff181 commit 723d061

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

ext/odbc/php_odbc.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,9 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
13721372
result = Z_ODBC_RESULT_P(pv_res);
13731373
CHECK_ODBC_RESULT(result);
13741374

1375-
/* TODO deprecate $row argument values less than 1 after PHP 8.4 */
1375+
if (!pv_row_is_null && pv_row < 1) {
1376+
php_error_docref(NULL, E_WARNING, "Row number must be at least 1");
1377+
}
13761378

13771379
#ifndef HAVE_SQL_EXTENDED_FETCH
13781380
if (!pv_row_is_null && pv_row > 0) {
@@ -1537,7 +1539,9 @@ PHP_FUNCTION(odbc_fetch_into)
15371539
result = Z_ODBC_RESULT_P(pv_res);
15381540
CHECK_ODBC_RESULT(result);
15391541

1540-
/* TODO deprecate $row argument values less than 1 after PHP 8.4 */
1542+
if (!pv_row_is_null && pv_row < 1) {
1543+
php_error_docref(NULL, E_WARNING, "Row number must be at least 1");
1544+
}
15411545

15421546
#ifndef HAVE_SQL_EXTENDED_FETCH
15431547
if (!pv_row_is_null && pv_row > 0) {

0 commit comments

Comments
 (0)