Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions ext/odbc/php_odbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1344,11 +1344,8 @@ static void php_odbc_fetch(INTERNAL_FUNCTION_PARAMETERS, bool return_array, php_
result = Z_ODBC_RESULT_P(pv_res);
CHECK_ODBC_RESULT(result);

/* TODO deprecate $row argument values less than 1 after PHP 8.4
* for functions other than odbc_fetch_row (see GH-13910)
*/
if (!result_type && !pv_row_is_null && pv_row < 1) {
php_error_docref(NULL, E_WARNING, "Argument #3 ($row) must be greater than or equal to 1");
if (!pv_row_is_null && pv_row < 1) {
php_error_docref(NULL, E_WARNING, "Last argument ($row) must be greater than or equal to 1");
RETURN_FALSE;
}

Expand Down
2 changes: 1 addition & 1 deletion ext/odbc/tests/odbc_fetch_array_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ odbc_exec($conn, 'INSERT INTO fetch_array VALUES (1), (2)');
$res = odbc_exec($conn, 'SELECT * FROM fetch_array');

var_dump(odbc_fetch_array($res));
var_dump(odbc_fetch_array($res, 0));
var_dump(odbc_fetch_array($res));
var_dump(odbc_fetch_array($res, 2));
var_dump(odbc_fetch_array($res, 4));

Expand Down
2 changes: 1 addition & 1 deletion ext/odbc/tests/odbc_fetch_into_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $arr = [];
var_dump(odbc_fetch_into($res, $arr));
var_dump($arr);
$arr = [];
var_dump(odbc_fetch_into($res, $arr, 0));
var_dump(odbc_fetch_into($res, $arr));
var_dump($arr);
$arr = [];
var_dump(odbc_fetch_into($res, $arr, 2));
Expand Down
2 changes: 1 addition & 1 deletion ext/odbc/tests/odbc_fetch_object_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ odbc_exec($conn, 'INSERT INTO fetch_object VALUES (1), (2)');
$res = odbc_exec($conn, 'SELECT * FROM fetch_object');

var_dump(odbc_fetch_object($res));
var_dump(odbc_fetch_object($res, 0));
var_dump(odbc_fetch_object($res));
var_dump(odbc_fetch_object($res, 2));
var_dump(odbc_fetch_object($res, 4));

Expand Down
2 changes: 1 addition & 1 deletion ext/odbc/tests/odbc_fetch_row_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ $conn = odbc_connect($dsn, $user, $pass);
odbc_exec($conn, 'DROP TABLE fetch_row');
?>
--EXPECTF--
Warning: odbc_fetch_row(): Argument #3 ($row) must be greater than or equal to 1 in %s on line %d
Warning: odbc_fetch_row(): Last argument ($row) must be greater than or equal to 1 in %s on line %d
bool(false)
bool(true)
string(1) "1"
Expand Down
Loading