From eaffa1150aa0083fc0d822aed535a94cf13b41f9 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 27 Nov 2024 15:51:16 +0000 Subject: [PATCH] ext/gmp: Compare object CE to gmp_ce directly The GMP class is now final, therefore we don't need to use the instanceof function. --- ext/gmp/gmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index d60df0e2494..a23263d407e 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -96,7 +96,7 @@ PHP_GMP_API zend_class_entry *php_gmp_class_entry(void) { ((__GNU_MP_VERSION >= 6) || (__GNU_MP_VERSION >= 5 && __GNU_MP_VERSION_MINOR >= 1)) #define IS_GMP(zval) \ - (Z_TYPE_P(zval) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zval), gmp_ce)) + (Z_TYPE_P(zval) == IS_OBJECT && Z_OBJCE_P(zval) == gmp_ce) #define GET_GMP_OBJECT_FROM_OBJ(obj) \ php_gmp_object_from_zend_object(obj) @@ -116,7 +116,7 @@ static bool gmp_zend_parse_arg_into_mpz_ex( bool is_operator ) { if (EXPECTED(Z_TYPE_P(arg) == IS_OBJECT)) { - if (EXPECTED(instanceof_function(Z_OBJCE_P(arg), gmp_ce))) { + if (EXPECTED(Z_OBJCE_P(arg) == gmp_ce)) { *destination_mpz_ptr = GET_GMP_FROM_ZVAL(arg); return true; }