GMP compatibility with PHP 5.6
authorDan Fuhry <dan@enanocms.org>
Mon, 24 Nov 2014 11:40:24 -0500
changeset 1380 0e400f946644
parent 1379 5cbd678df965
child 1381 6b25c6bfd246
GMP compatibility with PHP 5.6
includes/math.php
--- a/includes/math.php	Wed Aug 21 23:11:58 2013 -0400
+++ b/includes/math.php	Mon Nov 24 11:40:24 2014 -0500
@@ -29,7 +29,7 @@
 	
 	function init($int, $base = 10)
 	{
-		return ( is_resource($int) ) ? $int : gmp_init($int, $base);
+		return ( is_resource($int) || (is_object($int) && $int instanceof \GMP) ) ? $int : gmp_init($int, $base);
 	}
 	
 	/**