mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-27 09:08:24 +00:00
BigInteger: accomodate GMP change in PHP 5.6
This commit is contained in:
parent
ba5101e77b
commit
a43dd38365
@ -329,9 +329,12 @@ class Math_BigInteger
|
|||||||
|
|
||||||
switch ( MATH_BIGINTEGER_MODE ) {
|
switch ( MATH_BIGINTEGER_MODE ) {
|
||||||
case MATH_BIGINTEGER_MODE_GMP:
|
case MATH_BIGINTEGER_MODE_GMP:
|
||||||
if (is_resource($x) && get_resource_type($x) == 'GMP integer') {
|
switch (true) {
|
||||||
$this->value = $x;
|
case is_resource($x) && get_resource_type($x) == 'GMP integer':
|
||||||
return;
|
// PHP 5.6 switched GMP from using resources to objects
|
||||||
|
case is_object($x) && get_class($x) == 'GMP':
|
||||||
|
$this->value = $x;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
$this->value = gmp_init(0);
|
$this->value = gmp_init(0);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user