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:
Andreas Fischer 2014-10-19 20:46:07 +02:00
commit 1f28502828

View File

@ -915,7 +915,7 @@ class Math_BigInteger
$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;
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) {
$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 = $result[MATH_BIGINTEGER_VALUE];
}
@ -3482,7 +3482,7 @@ class Math_BigInteger
}
if ( $carry ) {
$this->value[] = $carry;
$this->value[count($this->value)] = $carry;
}
while ($num_digits--) {