Skip to content

Commit baf8493

Browse files
committed
Fix compilation for PHP 8.1
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
1 parent 4fdda13 commit baf8493

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/common.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,17 @@ int name##_unserialize( \
222222
zend_ce_error, \
223223
"Immutable objects may not be changed")
224224

225+
// https://bugs.php.net/bug.php?id=80816
226+
#if PHP_VERSION_ID >= 80100
227+
#define spl_ce_Aggregate zend_ce_aggregate
228+
#define spl_ce_ArrayAccess zend_ce_arrayaccess
229+
#define spl_ce_Countable zend_ce_countable
230+
#define spl_ce_Iterator zend_ce_iterator
231+
#define spl_ce_Serializable zend_ce_serializable
232+
#define spl_ce_Stringable zend_ce_stringable
233+
#define spl_ce_Traversable zend_ce_traversable
234+
#endif
235+
225236
/**
226237
*
227238
*/

src/php/arginfo.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ ZEND_END_ARG_INFO()
110110
{ (const char*)(zend_uintptr_t)(required_num_args), class_name, IS_OBJECT, pass_by_ref, allow_null, 0 },
111111
#endif
112112

113-
#if PHP_VERSION_ID >= 80000
113+
#if PHP_VERSION_ID >= 80100
114+
#define DS_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, pass_by_ref, required_num_args, type, allow_null) \
115+
static const zend_internal_arg_info arginfo_##name[] = { \
116+
{ (const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_CODE(type, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0, 0)) },
117+
#elif PHP_VERSION_ID >= 80000
114118
#define DS_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, pass_by_ref, required_num_args, type, allow_null) \
115119
static const zend_internal_arg_info arginfo_##name[] = { \
116120
{ (const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_CODE(type, allow_null, _ZEND_ARG_INFO_FLAGS(pass_by_ref, 0)) },

0 commit comments

Comments
 (0)