around.
- DBA
- . dba_delete() now returns false if the key was not found for the inifile
+ . dba_delete() now returns false if the key was not found for the inifile
handler, too.
+- GMP
+ . gmp_setbit() and gmp_clrbit() now return FALSE for negative indices, making
+ them consistent with other GMP functions.
+
========================================
2. New Features
========================================
if (index < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero");
- return;
+ RETURN_FALSE;
}
gmpnum_a = GET_GMP_FROM_ZVAL(a_arg);
if (index < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero");
- return;
+ RETURN_FALSE;
}
gmpnum_a = GET_GMP_FROM_ZVAL(a_arg);
var_dump(gmp_strval($n));
$n = gmp_init(-1);
-gmp_clrbit($n, -1);
+var_dump(gmp_clrbit($n, -1));
var_dump(gmp_strval($n));
$n = gmp_init("1000000");
echo "Done\n";
?>
---EXPECTF--
+--EXPECTF--
string(1) "0"
Warning: gmp_clrbit(): Index must be greater than or equal to zero in %s on line %d
+bool(false)
string(2) "-1"
Warning: gmp_clrbit(): Index must be greater than or equal to zero in %s on line %d
var_dump(gmp_strval($n));
$n = gmp_init(5);
-gmp_setbit($n, -20, 0);
+var_dump(gmp_setbit($n, -20, 0));
var_dump(gmp_strval($n));
$n = gmp_init(5);
echo "Done\n";
?>
---EXPECTF--
+--EXPECTF--
string(2) "-1"
Warning: gmp_setbit(): Index must be greater than or equal to zero in %s on line %d
+bool(false)
string(1) "5"
string(1) "1"
string(1) "7"