mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-09 15:20:58 +00:00
Merge pull request #493 from bantu/fix-491
Restore compatibility with PHP 5.6.1 by using explicit array index. * bantu/fix-491: Restore compatibility with PHP 5.6.1 by using explicit array indexes.
This commit is contained in:
commit
1f28502828
@ -915,7 +915,7 @@ class Math_BigInteger
|
|||||||
$value = $x_value;
|
$value = $x_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
$value[] = 0; // just in case the carry adds an extra digit
|
$value[count($value)] = 0; // just in case the carry adds an extra digit
|
||||||
|
|
||||||
$carry = 0;
|
$carry = 0;
|
||||||
for ($i = 0, $j = 1; $j < $size; $i+=2, $j+=2) {
|
for ($i = 0, $j = 1; $j < $size; $i+=2, $j+=2) {
|
||||||
@ -2137,7 +2137,7 @@ class Math_BigInteger
|
|||||||
|
|
||||||
if ($this->_compare($result, false, $temp[MATH_BIGINTEGER_VALUE], $temp[MATH_BIGINTEGER_SIGN]) < 0) {
|
if ($this->_compare($result, false, $temp[MATH_BIGINTEGER_VALUE], $temp[MATH_BIGINTEGER_SIGN]) < 0) {
|
||||||
$corrector_value = $this->_array_repeat(0, $n_length + 1);
|
$corrector_value = $this->_array_repeat(0, $n_length + 1);
|
||||||
$corrector_value[] = 1;
|
$corrector_value[count($corrector_value)] = 1;
|
||||||
$result = $this->_add($result, false, $corrector_value, false);
|
$result = $this->_add($result, false, $corrector_value, false);
|
||||||
$result = $result[MATH_BIGINTEGER_VALUE];
|
$result = $result[MATH_BIGINTEGER_VALUE];
|
||||||
}
|
}
|
||||||
@ -3482,7 +3482,7 @@ class Math_BigInteger
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( $carry ) {
|
if ( $carry ) {
|
||||||
$this->value[] = $carry;
|
$this->value[count($this->value)] = $carry;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ($num_digits--) {
|
while ($num_digits--) {
|
||||||
|
Loading…
Reference in New Issue
Block a user