Skip to content

Commit b332afb

Browse files
committed
Implement GMP supports different
1 parent 69b8a7b commit b332afb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Encoder/GMPEncoder.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ public function getDefaultOptions()
1717

1818
public function supports($value)
1919
{
20-
return version_compare(PHP_VERSION, '5.6.0', '>=')
21-
? is_object($value) && $value instanceof \GMP
22-
: is_resource($value) && get_resource_type($value) === 'GMP integer';
20+
if (version_compare(PHP_VERSION, '5.6.0', '>=')) {
21+
return is_object($value) && get_class($value) === 'GMP';
22+
}
23+
24+
return is_resource($value) && get_resource_type($value) === 'GMP integer';
2325
}
2426

2527
public function encode($value, $depth, array $options, callable $encode)

0 commit comments

Comments
 (0)