Fix encoding of GMP objects in PHP 5.6.0+