@@ -129,6 +129,9 @@ typedef zend_object php7to8_object;
129129#define PHP7TO8_ARG_INFO_VOID_RETURN (arginfo ) \
130130 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo, 0, 0, IS_VOID, 0) \
131131 ZEND_END_ARG_INFO()
132+ #define PHP7TO8_ARG_INFO_STRING_RETURN (arginfo ) \
133+ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo, 0, 0, IS_STRING, 0) \
134+ ZEND_END_ARG_INFO()
132135#define PHP7TO8_ARG_INFO_BOOL_RETURN (arginfo ) \
133136 ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo, 0, 0, _IS_BOOL, 0) \
134137 ZEND_END_ARG_INFO()
@@ -172,6 +175,9 @@ typedef zval php7to8_object;
172175#define PHP7TO8_ARG_INFO_VOID_RETURN (arginfo ) \
173176 ZEND_BEGIN_ARG_INFO_EX(arginfo, 0, ZEND_RETURN_VALUE, 0) \
174177 ZEND_END_ARG_INFO()
178+ #define PHP7TO8_ARG_INFO_STRING_RETURN (arginfo ) \
179+ ZEND_BEGIN_ARG_INFO_EX(arginfo, 0, ZEND_RETURN_VALUE, 0) \
180+ ZEND_END_ARG_INFO()
175181#define PHP7TO8_ARG_INFO_BOOL_RETURN (arginfo ) \
176182 ZEND_BEGIN_ARG_INFO_EX(arginfo, 0, ZEND_RETURN_VALUE, 0) \
177183 ZEND_END_ARG_INFO()
@@ -200,6 +206,12 @@ typedef zval php7to8_object;
200206 ZEND_END_ARG_INFO()
201207#endif
202208
209+ #if ((PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION >= 2 ) || PHP_MAJOR_VERSION > 8 )
210+ #define PHP7TO82_ZEND_KEY () __key ? __key->val : NULL
211+ #else
212+ #define PHP7TO82_ZEND_KEY () _p->key ? _p->key->val : NULL
213+ #endif
214+
203215#if PHP_MAJOR_VERSION >= 7
204216#define php5to7_zend_register_internal_class_ex (ce , parent_ce ) zend_register_internal_class_ex((ce), (parent_ce) TSRMLS_CC);
205217
@@ -276,11 +288,7 @@ php5to7_string_compare(php5to7_string s1, php5to7_string s2)
276288
277289#define PHP5TO7_ZEND_HASH_FOREACH_STR_KEY_VAL (ht , _key , _val ) \
278290 ZEND_HASH_FOREACH(ht, 0); \
279- if (_p->key) { \
280- (_key) = _p->key->val; \
281- } else { \
282- (_key) = NULL; \
283- } \
291+ _key = PHP7TO82_ZEND_KEY(); \
284292 _val = _z;
285293
286294#define PHP5TO7_ZEND_HASH_FOREACH_END (ht ) ZEND_HASH_FOREACH_END()
0 commit comments