From 4b998185887213029616163c6fa336d6a985ff06 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 13 Sep 2022 11:06:35 +0200 Subject: [PATCH] fix __toString return type for PHP 8.2 --- mustache_ast.cpp | 4 ++++ mustache_template.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/mustache_ast.cpp b/mustache_ast.cpp index eb0ba06..70abc4b 100644 --- a/mustache_ast.cpp +++ b/mustache_ast.cpp @@ -24,7 +24,11 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(MustacheAST__toArray_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(MustacheAST____toString_args, 0, 0, IS_STRING, 0) +#else ZEND_BEGIN_ARG_INFO_EX(MustacheAST____toString_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(MustacheAST____wakeup_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) diff --git a/mustache_template.cpp b/mustache_template.cpp index e25ab24..7cd47a6 100644 --- a/mustache_template.cpp +++ b/mustache_template.cpp @@ -17,7 +17,11 @@ ZEND_BEGIN_ARG_INFO_EX(MustacheTemplate____construct_args, ZEND_SEND_BY_VAL, ZEN ZEND_ARG_INFO(0, vars) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(MustacheTemplate____toString_args, 0, 0, IS_STRING, 0) +#else ZEND_BEGIN_ARG_INFO_EX(MustacheTemplate____toString_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +#endif ZEND_END_ARG_INFO() /* }}} */