fix #41: PHP-8.1 compat
authorMichael Wallner <mike@php.net>
Tue, 10 Aug 2021 07:36:14 +0000 (09:36 +0200)
committerMichael Wallner <mike@php.net>
Tue, 10 Aug 2021 07:36:14 +0000 (09:36 +0200)
src/php_pq_misc.h
src/php_pqres.c

index 1285d8ecd30625513e3a6518388f07213dd0b630..34ab6c1bf9c285f5a75c18883abb3cc07ca46787 100644 (file)
@@ -92,7 +92,12 @@ extern int php_pq_compare_index(const void *lptr, const void *rptr);
                                SUCCESS == Z_OBJ_HT_P(objval_ptr)->cast_object(objval_ptr, (retval_ptr), (cast_type)))
 #endif
 
-
+#if PHP_VERSION_ID < 80100
+# define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \
+                ZEND_BEGIN_ARG_INFO_EX(name, 0, return_reference, required_num_args)
+# define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, type, allow_null) \
+                ZEND_BEGIN_ARG_INFO_EX(name, 0, return_reference, required_num_args)
+#endif
 
 
 extern PHP_MINIT_FUNCTION(pq_misc);
index be3d039e9699e5142903f548fe7570009fd047e1..d9b10518b32118ba86b5b3dcd93f33bf47f5f62b 100644 (file)
@@ -1146,7 +1146,7 @@ static PHP_METHOD(pqres, fetchAll) {
        }
 }
 
-ZEND_BEGIN_ARG_INFO_EX(ai_pqres_count, 0, 0, 0)
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(ai_pqres_count, 0, 0, IS_LONG, 0)
 ZEND_END_ARG_INFO();
 static PHP_METHOD(pqres, count) {
        zend_error_handling zeh;
@@ -1194,7 +1194,7 @@ static PHP_METHOD(pqres, desc) {
 }
 
 #if PHP_VERSION_ID >= 80000
-ZEND_BEGIN_ARG_INFO_EX(ai_pqres_getIterator, 0, 0, 0)
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(ai_pqres_getIterator, 0, 0, Traversable, 0)
 ZEND_END_ARG_INFO();
 static PHP_METHOD(pqres, getIterator)
 {